diff --git a/openedx/core/djangoapps/user_authn/views/register.py b/openedx/core/djangoapps/user_authn/views/register.py index 0d19bdfd4dd8527f07e88688a5f14e978cd5b639..cc57b1752fc7612f3475d5f369ca9c635bf39889 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)