From d8208964a41918496f1c44d58e4bd8e7b2cbe8b1 Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Thu, 7 Mar 2024 14:57:21 +0500 Subject: [PATCH] feat: make user active in case of drupal --- common/djangoapps/student/helpers.py | 4 ++-- openedx/core/djangoapps/user_authn/views/register.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/student/helpers.py b/common/djangoapps/student/helpers.py index cfb047f1a947..4f686ecf1b73 100644 --- a/common/djangoapps/student/helpers.py +++ b/common/djangoapps/student/helpers.py @@ -672,7 +672,7 @@ def process_survey_link(survey_link, user): return survey_link.format(UNIQUE_ID=unique_id_for_user(user)) -def do_create_account(form, custom_form=None): +def do_create_account(form, custom_form=None, is_active=False): """ Given cleaned post variables, create the User and UserProfile objects, as well as the registration for this user. @@ -700,7 +700,7 @@ def do_create_account(form, custom_form=None): user = User( username=proposed_username, email=form.cleaned_data["email"], - is_active=False + is_active=is_active ) password = normalize_password(form.cleaned_data["password"]) user.set_password(password) diff --git a/openedx/core/djangoapps/user_authn/views/register.py b/openedx/core/djangoapps/user_authn/views/register.py index 30e850ce57ce..05ceba0f3cb2 100644 --- a/openedx/core/djangoapps/user_authn/views/register.py +++ b/openedx/core/djangoapps/user_authn/views/register.py @@ -231,11 +231,11 @@ def create_account_with_params(request, params): # pylint: disable=too-many-sta ) custom_form = get_registration_extension_form(data=params) is_marketable = params.get('marketing_emails_opt_in') in ['true', '1'] - + is_drupal = True if request.GET.get('is_drupal') else False # Perform operations within a transaction that are critical to account creation with outer_atomic(): # first, create the account - (user, profile, registration) = do_create_account(form, custom_form) + (user, profile, registration) = do_create_account(form, custom_form, is_drupal) third_party_provider, running_pipeline = _link_user_to_third_party_provider( is_third_party_auth_enabled, third_party_auth_credentials_in_api, user, request, params,