From 36db87e7348b28b920cb0d981bb68fb0d99fedcf Mon Sep 17 00:00:00 2001 From: Pierre Mailhot Date: Thu, 27 Aug 2020 03:37:05 -0400 Subject: [PATCH] fixing language issue for original activation email on sites using more than one language https://openedx.atlassian.net/browse/CRI-217 https://discuss.openedx.org/t/activation-email-in-multiple-languages/2808 --- openedx/core/djangoapps/user_authn/views/register.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openedx/core/djangoapps/user_authn/views/register.py b/openedx/core/djangoapps/user_authn/views/register.py index 0d19bdfd4d..cc57b1752f 100644 --- a/openedx/core/djangoapps/user_authn/views/register.py +++ b/openedx/core/djangoapps/user_authn/views/register.py @@ -214,6 +214,11 @@ def create_account_with_params(request, params): django_login(request, new_user) request.session.set_expiry(0) + # Sites using multiple languages need to record the language used during registration. + # If not, compose_and_send_activation_email will be sent in site's default language only. + create_or_set_user_attribute_created_on_site(user, request.site) + preferences_api.set_user_preference(user, LANGUAGE_KEY, get_language()) + # Check if system is configured to skip activation email for the current user. skip_email = _skip_activation_email( user, running_pipeline, third_party_provider, @@ -224,11 +229,6 @@ def create_account_with_params(request, params): else: compose_and_send_activation_email(user, profile, registration) - # Perform operations that are non-critical parts of account creation - create_or_set_user_attribute_created_on_site(user, request.site) - - preferences_api.set_user_preference(user, LANGUAGE_KEY, get_language()) - if settings.FEATURES.get('ENABLE_DISCUSSION_EMAIL_DIGEST'): try: enable_notifications(user)