From f6287694ae00e2e4d1ecacffabcde770a5e91cb5 Mon Sep 17 00:00:00 2001 From: Waheed Ahmed Date: Fri, 22 Jan 2021 12:12:51 +0500 Subject: [PATCH] Keep enterprise user on monolith FE. If an enterprise customer is associated with the request, keep the user on the monolith FE and do not redirect them to MFE. VAN-125 --- openedx/core/djangoapps/user_authn/views/login_form.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/user_authn/views/login_form.py b/openedx/core/djangoapps/user_authn/views/login_form.py index 0f453a8ad4..d116314444 100644 --- a/openedx/core/djangoapps/user_authn/views/login_form.py +++ b/openedx/core/djangoapps/user_authn/views/login_form.py @@ -184,8 +184,9 @@ def login_and_registration_form(request, initial_mode="login"): except (KeyError, ValueError, IndexError) as ex: log.exception(u"Unknown tpa_hint provider: %s", ex) + enterprise_customer = enterprise_customer_for_request(request) # Redirect to logistration MFE if it is enabled - if should_redirect_to_logistration_mircrofrontend(): + if should_redirect_to_logistration_mircrofrontend() and not enterprise_customer: query_params = request.GET.urlencode() url_path = '/{}{}'.format( initial_mode, @@ -245,7 +246,7 @@ def login_and_registration_form(request, initial_mode="login"): settings.FEATURES['ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER'] ), } - enterprise_customer = enterprise_customer_for_request(request) + update_logistration_context_for_enterprise(request, context, enterprise_customer) response = render_to_response('student_account/login_and_register.html', context)