fixup! updated URL config name and value; added DEPR ticket
This commit is contained in:
@@ -2452,11 +2452,6 @@ MOBILE_STORE_URLS = {
|
||||
'google': '#'
|
||||
}
|
||||
|
||||
################# Learner Profile ##################
|
||||
|
||||
# TODO (DEPR-TODO)
|
||||
PROFILE_MICROFRONTEND_URL_BASE = "http://localhost:18000/profile-spa/"
|
||||
|
||||
################# Student Verification #################
|
||||
VERIFY_STUDENT = {
|
||||
"DAYS_GOOD_FOR": 365, # How many days is a verficiation good for?
|
||||
@@ -3460,11 +3455,17 @@ RETIREMENT_STATES = [
|
||||
'COMPLETE',
|
||||
]
|
||||
|
||||
############## Settings for Writable Gradebook #########################
|
||||
############## Settings for Microfrontends #########################
|
||||
# If running a Gradebook container locally,
|
||||
# modify lms/envs/private.py to give it a non-null value
|
||||
WRITABLE_GRADEBOOK_URL = None
|
||||
|
||||
# TODO (DEPR-17)
|
||||
# This URL value is needed to redirect the old profile page to a new
|
||||
# micro-frontend based implementation. Once the old implementation is
|
||||
# completely removed and this redirect is no longer needed, we can remove this.
|
||||
PROFILE_MICROFRONTEND_URL = "http://some.profile.spa/u/"
|
||||
|
||||
############### Settings for django-fernet-fields ##################
|
||||
FERNET_KEYS = [
|
||||
'DUMMY KEY CHANGE BEFORE GOING TO PRODUCTION',
|
||||
|
||||
@@ -307,9 +307,6 @@ ACTIVATION_EMAIL_SUPPORT_LINK = ENV_TOKENS.get(
|
||||
# Mobile store URL overrides
|
||||
MOBILE_STORE_URLS = ENV_TOKENS.get('MOBILE_STORE_URLS', MOBILE_STORE_URLS)
|
||||
|
||||
# Learner Profile URL overrides
|
||||
PROFILE_MICROFRONTEND_URL_BASE = ENV_TOKENS.get('PROFILE_MICROFRONTEND_URL_BASE', PROFILE_MICROFRONTEND_URL_BASE)
|
||||
|
||||
# Timezone overrides
|
||||
TIME_ZONE = ENV_TOKENS.get('CELERY_TIMEZONE', CELERY_TIMEZONE)
|
||||
|
||||
@@ -1101,8 +1098,9 @@ RETIREMENT_STATES = ENV_TOKENS.get('RETIREMENT_STATES', RETIREMENT_STATES)
|
||||
############## Settings for Course Enrollment Modes ######################
|
||||
COURSE_ENROLLMENT_MODES = ENV_TOKENS.get('COURSE_ENROLLMENT_MODES', COURSE_ENROLLMENT_MODES)
|
||||
|
||||
############## Settings for Writable Gradebook #########################
|
||||
############## Settings for Microfrontend URLS #########################
|
||||
WRITABLE_GRADEBOOK_URL = ENV_TOKENS.get('WRITABLE_GRADEBOOK_URL', WRITABLE_GRADEBOOK_URL)
|
||||
PROFILE_MICROFRONTEND_URL = ENV_TOKENS.get('PROFILE_MICROFRONTEND_URL', PROFILE_MICROFRONTEND_URL)
|
||||
|
||||
############################### Plugin Settings ###############################
|
||||
|
||||
|
||||
@@ -116,12 +116,12 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
|
||||
self.assertIn(attribute, response.content)
|
||||
|
||||
def test_redirect_view(self):
|
||||
profile_url_base = "http://profile-spa/"
|
||||
with override_settings(PROFILE_MICROFRONTEND_URL_BASE=profile_url_base):
|
||||
profile_url = "http://profile-spa/abc/"
|
||||
with override_settings(PROFILE_MICROFRONTEND_URL=profile_url):
|
||||
with override_waffle_flag(REDIRECT_TO_PROFILE_MICROFRONTEND, active=True):
|
||||
profile_path = reverse('learner_profile', kwargs={'username': self.USERNAME})
|
||||
response = self.client.get(path=profile_path)
|
||||
self.assertRedirects(response, profile_url_base + self.USERNAME, target_status_code=404)
|
||||
self.assertRedirects(response, profile_url + self.USERNAME, target_status_code=404)
|
||||
|
||||
def test_records_link(self):
|
||||
profile_path = reverse('learner_profile', kwargs={'username': self.USERNAME})
|
||||
|
||||
@@ -48,7 +48,7 @@ def learner_profile(request, username):
|
||||
GET /account/profile
|
||||
"""
|
||||
if REDIRECT_TO_PROFILE_MICROFRONTEND.is_enabled():
|
||||
profile_microfrontend_url = "{}{}".format(settings.PROFILE_MICROFRONTEND_URL_BASE, username)
|
||||
profile_microfrontend_url = "{}{}".format(settings.PROFILE_MICROFRONTEND_URL, username)
|
||||
return redirect(profile_microfrontend_url)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user