Commit e11f7edf authored by Georg Krause's avatar Georg Krause
Browse files

Merge branch '1482' into 'develop'

Resolves #1482

Closes #1482

See merge request !1321
parents 6a20f48a f661e3a0
......@@ -649,11 +649,11 @@ useful when testing components that depend on each other:
def notify(email, message):
"""
A function that sends an email to the given recipient
A function that sends an e-mail to the given recipient
with the given message
"""
# our email sending logic here
# our e-mail sending logic here
# ...
# funkwhale_api/myapp/users.py
......@@ -675,9 +675,9 @@ useful when testing components that depend on each other:
def test_downgrade_superuser_sends_email(factories, mocker):
"""
Your downgrade logic is already tested, however, we want to ensure
an email is sent when user is downgraded, but we don't have any email
an e-mail is sent when user is downgraded, but we don't have any e-mail
server available in our testing environment. Thus, we need to mock
the email sending process.
the e-mail sending process.
"""
mocked_notify = mocker.patch('funkwhale_api.myapp.notifications.notify')
user = factories['users.User'](is_superuser=True)
......@@ -692,7 +692,7 @@ useful when testing components that depend on each other:
user = factories['users.User'](is_superuser=False)
users.downgrade_user(user)
# here, we ensure no email was sent
# here, we ensure no e-mail was sent
mocked_notify.assert_not_called()
Views: you can find some readable views tests in file: ``api/tests/users/test_views.py``
......
......@@ -308,7 +308,7 @@ DEFAULT_FROM_EMAIL = env(
"DEFAULT_FROM_EMAIL", default="Funkwhale <noreply@{}>".format(FUNKWHALE_HOSTNAME)
)
"""
Name and email address used to send system emails.
Name and e-mail address used to send system e-mails.
Default: ``Funkwhale <noreply@yourdomain>``
......@@ -320,17 +320,17 @@ Default: ``Funkwhale <noreply@yourdomain>``
"""
EMAIL_SUBJECT_PREFIX = env("EMAIL_SUBJECT_PREFIX", default="[Funkwhale] ")
"""
Subject prefix for system emails.
Subject prefix for system e-mails.
"""
SERVER_EMAIL = env("SERVER_EMAIL", default=DEFAULT_FROM_EMAIL)
EMAIL_CONFIG = env.email_url("EMAIL_CONFIG", default="consolemail://")
"""
SMTP configuration for sending emails. Possible values:
SMTP configuration for sending e-mails. Possible values:
- ``EMAIL_CONFIG=consolemail://``: output emails to console (the default)
- ``EMAIL_CONFIG=dummymail://``: disable email sending completely
- ``EMAIL_CONFIG=consolemail://``: output e-mails to console (the default)
- ``EMAIL_CONFIG=dummymail://``: disable e-mail sending completely
On a production instance, you'll usually want to use an external SMTP server:
......@@ -591,10 +591,11 @@ ACCOUNT_EMAIL_VERIFICATION_ENFORCE = env.bool(
"ACCOUNT_EMAIL_VERIFICATION_ENFORCE", default=False
)
"""
Determine wether users need to verify their email address before using
the service. Enabling this can be useful to reduce spam or bots accounts,
however, you'll need to configure a mail server so that your users can receive
the verification emails, using :attr:`EMAIL_CONFIG`.
Determine wether users need to verify their e-mail address before using the service. Enabling this can be useful
to reduce spam or bots accounts, however, you'll need to configure a mail server so that your users can receive the
verification e-mails, using :attr:`EMAIL_CONFIG`.
Note that regardless of the setting value, superusers created through the command line will never require verification.
Note that regardless of the setting value, superusers created through the
command line will never require verification.
......@@ -1255,7 +1256,7 @@ MODERATION_EMAIL_NOTIFICATIONS_ENABLED = env.bool(
"MODERATION_EMAIL_NOTIFICATIONS_ENABLED", default=True
)
"""
Whether to enable email notifications to moderators and pods admins.
Whether to enable e-mail notifications to moderators and pods admins.
"""
FEDERATION_AUTHENTIFY_FETCHES = True
FEDERATION_SYNCHRONOUS_FETCH = env.bool("FEDERATION_SYNCHRONOUS_FETCH", default=True)
......
......@@ -3,7 +3,7 @@
Local settings
- Run in Debug mode
- Use console backend for emails
- Use console backend for e-mails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
......
......@@ -4,7 +4,7 @@ Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use mailgun to send e-mails
- Use Redis on Heroku
......
......@@ -37,7 +37,7 @@ def handler_create_user(
utils.logger.debug("Validating user data…")
serializer.is_valid(raise_exception=True)
# Override email validation, we assume accounts created from CLI have a valid email
# Override e-mail validation, we assume accounts created from CLI have a valid e-mail
request = FakeRequest(session={"account_verified_email": email})
utils.logger.debug("Creating user…")
user = serializer.save(request=request)
......
......@@ -73,7 +73,7 @@ class InstanceContactEmail(types.StringPreference):
name = "contact_email"
verbose_name = "Contact email"
default = ""
help_text = "A contact email for visitors who need to contact an admin or moderator"
help_text = "A contact e-mail address for visitors who need to contact an admin or moderator"
field_kwargs = {"required": False}
......
......@@ -304,7 +304,7 @@ class ReportSerializer(serializers.ModelSerializer):
if not validated_data.get("submitter_email"):
raise serializers.ValidationError(
"You need to provide an email address to submit this report"
"You need to provide an e-mail address to submit this report"
)
return validated_data
......
......@@ -106,14 +106,16 @@ def send_new_report_email_to_moderators(report):
"",
"—",
"",
"You are receiving this email because you are a moderator for {}.".format(
"You are receiving this e-mail because you are a moderator for {}.".format(
settings.FUNKWHALE_HOSTNAME
),
]
for moderator in moderators:
if not moderator.email:
logger.warning("Moderator %s has no email configured", moderator.username)
logger.warning(
"Moderator %s has no e-mail address configured", moderator.username
)
continue
mail.send_mail(
subject,
......@@ -192,14 +194,16 @@ def notify_mods_signup_request_pending(obj):
"",
"—",
"",
"You are receiving this email because you are a moderator for {}.".format(
"You are receiving this e-mail because you are a moderator for {}.".format(
settings.FUNKWHALE_HOSTNAME
),
]
for moderator in moderators:
if not moderator.email:
logger.warning("Moderator %s has no email configured", moderator.username)
logger.warning(
"Moderator %s has no e-mail address configured", moderator.username
)
continue
mail.send_mail(
subject,
......@@ -213,7 +217,7 @@ def notify_submitter_signup_request_approved(user_request):
submitter_repr = user_request.submitter.preferred_username
submitter_email = user_request.submitter.user.email
if not submitter_email:
logger.warning("User %s has no email configured", submitter_repr)
logger.warning("User %s has no e-mail address configured", submitter_repr)
return
subject = "Welcome to {}, {}!".format(settings.FUNKWHALE_HOSTNAME, submitter_repr)
login_url = federation_utils.full_url("/login")
......@@ -223,7 +227,7 @@ def notify_submitter_signup_request_approved(user_request):
"Our moderation team has approved your account request and you can now start "
"using the service. Please visit {} to get started.".format(login_url),
"",
"Before your first login, you may need to verify your email address if you didn't already.",
"Before your first login, you may need to verify your e-mail address if you didn't already.",
]
mail.send_mail(
......@@ -238,7 +242,7 @@ def notify_submitter_signup_request_refused(user_request):
submitter_repr = user_request.submitter.preferred_username
submitter_email = user_request.submitter.user.email
if not submitter_email:
logger.warning("User %s has no email configured", submitter_repr)
logger.warning("User %s has no e-mail address configured", submitter_repr)
return
subject = "Your account request at {} was refused".format(
settings.FUNKWHALE_HOSTNAME
......
......@@ -28,7 +28,7 @@ def authenticate(username, password):
raise exceptions.AuthenticationFailed("Wrong username or password.")
if common_authentication.should_verify_email(user):
raise exceptions.AuthenticationFailed("You need to verify your email.")
raise exceptions.AuthenticationFailed("You need to verify your e-mail address.")
return (user, None)
......@@ -47,7 +47,7 @@ def authenticate_salt(username, salt, token):
raise exceptions.AuthenticationFailed("Wrong username or password.")
if common_authentication.should_verify_email(user):
raise exceptions.AuthenticationFailed("You need to verify your email.")
raise exceptions.AuthenticationFailed("You need to verify your e-mail address.")
return (user, None)
......
{% load i18n %}{% autoescape off %}
{% blocktrans with site_name=funkwhale_site_name %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% blocktrans with site_name=funkwhale_site_name %}You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{{ funkwhale_url }}/auth/password/reset/confirm?uid={{ uid }}&token={{ token }}
......
......@@ -10,7 +10,7 @@ class Scope:
BASE_SCOPES = [
Scope(
"profile", "Access profile data (email, username, avatar, subsonic password…)"
"profile", "Access profile data (e-mail, username, avatar, subsonic password…)"
),
Scope("libraries", "Access uploads, libraries, and audio metadata"),
Scope("edits", "Browse and submit edits on audio metadata"),
......
......@@ -38,8 +38,8 @@ urlpatterns = [
name="change_password",
),
# This url is used by django-allauth and empty TemplateView is
# defined just to allow reverse() call inside app, for example when email
# with verification link is being sent, then it's required to render email
# defined just to allow reverse() call inside app, for example when e-mail
# with verification link is being sent, then it's required to render e-mail
# content.
# account_confirm_email - You should override this view to handle it in
# your API client somehow and then, send post to /verify-email/ endpoint
......
......@@ -294,7 +294,7 @@ class UserChangeEmailSerializer(serializers.Serializer):
.exclude(user=self.context["user"])
.exists()
):
raise serializers.ValidationError("This email address is already in use")
raise serializers.ValidationError("This e-mail address is already in use")
return value
def save(self, request):
......
......@@ -38,7 +38,7 @@ class RegisterView(registration_views.RegisterView):
def perform_create(self, serializer):
user = super().perform_create(serializer)
if not user.is_active:
# manual approval, we need to send the confirmation email by hand
# manual approval, we need to send the confirmation e-mail by hand
authentication.send_email_confirmation(self.request, user)
return user
......
......@@ -203,9 +203,9 @@ def test_report_serializer_repr(factories, to_api_date):
{"type": "other", "submitter_email": "hello@example.test"},
False,
),
# anonymous reports enabled for the category, but invalid email
# anonymous reports enabled for the category, but invalid e-mail
(["other"], {}, {"type": "other", "submitter_email": "hello@"}, False),
# anonymous reports enabled for the category, no email
# anonymous reports enabled for the category, no e-mail
(["other"], {}, {"type": "other"}, False),
# anonymous reports enabled for the category, actor object is empty
(["other"], {"submitter": None}, {"type": "other"}, False),
......
......@@ -15,9 +15,9 @@ def test_report_created_signal_calls_send_new_report_mail(factories, mocker):
def test_report_created_signal_sends_email_to_mods(factories, mailoutbox, settings):
mod1 = factories["users.User"](permission_moderation=True)
mod2 = factories["users.User"](permission_moderation=True)
# inactive, so no email
# inactive, so no e-mail
factories["users.User"](permission_moderation=True, is_active=False)
# no moderation permission, so no email
# no moderation permission, so no e-mail
factories["users.User"]()
report = factories["moderation.Report"]()
......
......@@ -427,5 +427,5 @@ def test_token_auth(
assert response.status_code == expected_status_code
if expected_status_code != 200:
# confirmation email should have been sent again
# confirmation e-mail should have been sent again
assert len(mailoutbox) == sent_emails + 1
......@@ -57,7 +57,7 @@ Define MEDIA_DIRECTORY_PATH ${FUNKWHALE_ROOT_PATH}/data/media
</IfModule>
# Turning ProxyRequests on and allowing proxying from all may allow
# spammers to use your proxy to send email.
# spammers to use your proxy to send e-mail.
ProxyRequests Off
<Proxy *>
......
......@@ -5,7 +5,7 @@
# following variables:
# - DJANGO_SECRET_KEY
# - FUNKWHALE_HOSTNAME
# - EMAIL_CONFIG and DEFAULT_FROM_EMAIL if you plan to send emails)
# - EMAIL_CONFIG and DEFAULT_FROM_EMAIL if you plan to send e-mails)
# On non-docker setup **only**, you'll also have to tweak/uncomment those variables:
# - DATABASE_URL
# - CACHE_URL
......@@ -43,21 +43,21 @@ FUNKWHALE_WEB_WORKERS=4
FUNKWHALE_HOSTNAME=yourdomain.funkwhale
FUNKWHALE_PROTOCOL=https
# Configure email sending using this variale
# By default, funkwhale will output emails sent to stdout
# Configure e-mail sending using this variale
# By default, funkwhale will output e-mails sent to stdout
# here are a few examples for this setting
# EMAIL_CONFIG=consolemail:// # output emails to console (the default)
# EMAIL_CONFIG=dummymail:// # disable email sending completely
# EMAIL_CONFIG=consolemail:// # output e-mails to console (the default)
# EMAIL_CONFIG=dummymail:// # disable e-mail sending completely
# On a production instance, you'll usually want to use an external SMTP server:
# EMAIL_CONFIG=smtp://user@:password@youremail.host:25
# EMAIL_CONFIG=smtp+ssl://user@:password@youremail.host:465
# EMAIL_CONFIG=smtp+tls://user@:password@youremail.host:587
# Make email verification mandatory before using the service
# Make e-mail verification mandatory before using the service
# Doesn't apply to admins.
# ACCOUNT_EMAIL_VERIFICATION_ENFORCE=false
# The email address to use to send system emails.
# The e-mail address to use to send system e-mails.
# DEFAULT_FROM_EMAIL=noreply@yourdomain
# Depending on the reverse proxy used in front of your funkwhale instance,
......
......@@ -738,7 +738,7 @@ Me:
email:
type: "string"
format: "email"
description: Email address associated with the account
description: E-mail address associated with the account
example: "alice@email.provider"
is_staff:
type: "boolean"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment