From 49ea5f5188546b7ab220bdfe3cb67f749b4dc7e3 Mon Sep 17 00:00:00 2001 From: Zainab Amir Date: Fri, 23 Oct 2020 12:11:56 +0500 Subject: [PATCH] Update logistration MFE feature flag (#25356) update logistration MFE feature flag to not be used in conjunction with Accounts MFE toggle. VAN-11 --- lms/envs/common.py | 5 ++-- lms/envs/devstack.py | 1 + lms/envs/devstack_decentralized.py | 1 + lms/envs/test.py | 1 + .../header/navbar-not-authenticated.html | 6 ++--- .../djangoapps/user_api/accounts/toggles.py | 9 -------- openedx/core/djangoapps/user_authn/utils.py | 11 +++++++++ .../core/djangoapps/user_authn/views/login.py | 2 +- .../djangoapps/user_authn/views/login_form.py | 4 ++-- .../user_authn/views/tests/test_login.py | 17 +++++--------- .../views/tests/test_logistration.py | 23 +++++-------------- .../header/navbar-not-authenticated.html | 4 ++-- 12 files changed, 37 insertions(+), 47 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index 3bfd566935..92247b6f71 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -601,8 +601,8 @@ FEATURES = { # .. toggle_creation_date: 2020-09-08 # .. toggle_target_removal_date: None # .. toggle_tickets: 'https://github.com/edx/edx-platform/pull/24908' - # .. toggle_warnings: Also set settings.ACCOUNT_MICROFRONTEND_URL and set REDIRECT_TO_ACCOUNT_MICROFRONTEND for - # rollout. This temporary feature toggle does not have a target removal date. + # .. toggle_warnings: Also set settings.LOGISTRATION_MICROFRONTEND_URL for rollout. This temporary feature + # toggle does not have a target removal date. 'ENABLE_LOGISTRATION_MICROFRONTEND': False, ### ORA Feature Flags ### @@ -4000,6 +4000,7 @@ WRITABLE_GRADEBOOK_URL = None PROFILE_MICROFRONTEND_URL = None ORDER_HISTORY_MICROFRONTEND_URL = None ACCOUNT_MICROFRONTEND_URL = None +LOGISTRATION_MICROFRONTEND_URL = None PROGRAM_CONSOLE_MICROFRONTEND_URL = None LEARNING_MICROFRONTEND_URL = None diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 93aa3159e3..06a8e59631 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -331,6 +331,7 @@ EDXNOTES_CLIENT_NAME = 'edx_notes_api-backend-service' ############## Settings for Microfrontends ######################### LEARNING_MICROFRONTEND_URL = 'http://localhost:2000' ACCOUNT_MICROFRONTEND_URL = 'http://localhost:1997' +LOGISTRATION_MICROFRONTEND_URL = 'http://localhost:1999' ############## Docker based devstack settings ####################### diff --git a/lms/envs/devstack_decentralized.py b/lms/envs/devstack_decentralized.py index 1790e0eee9..f08323b752 100644 --- a/lms/envs/devstack_decentralized.py +++ b/lms/envs/devstack_decentralized.py @@ -270,6 +270,7 @@ EDXNOTES_CLIENT_NAME = 'edx_notes_api-backend-service' ############## Settings for Microfrontends ######################### LEARNING_MICROFRONTEND_URL = 'http://localhost:2000' ACCOUNT_MICROFRONTEND_URL = 'http://localhost:1997' +LOGISTRATION_MICROFRONTEND_URL = 'http://localhost:1999' ############## Docker based devstack settings ####################### diff --git a/lms/envs/test.py b/lms/envs/test.py index 6a2055cede..f0a5163a95 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -571,6 +571,7 @@ PDF_RECEIPT_TAX_ID_LABEL = 'Tax ID' PROFILE_MICROFRONTEND_URL = "http://profile-mfe/abc/" ORDER_HISTORY_MICROFRONTEND_URL = "http://order-history-mfe/" ACCOUNT_MICROFRONTEND_URL = "http://account-mfe/" +LOGISTRATION_MICROFRONTEND_URL = "http://logistation-mfe" LEARNING_MICROFRONTEND_URL = "http://learning-mfe" ########################## limiting dashboard courses ###################### diff --git a/lms/templates/header/navbar-not-authenticated.html b/lms/templates/header/navbar-not-authenticated.html index c998d8cc87..84bcafb348 100644 --- a/lms/templates/header/navbar-not-authenticated.html +++ b/lms/templates/header/navbar-not-authenticated.html @@ -11,7 +11,7 @@ from django.urls import reverse from django.utils.translation import ugettext as _ from six import text_type -from openedx.core.djangoapps.user_api.accounts.toggles import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend %> <% @@ -51,7 +51,7 @@ from openedx.core.djangoapps.user_api.accounts.toggles import should_redirect_to % if allow_public_account_creation: % if should_redirect_to_logistration_mfe: % else: