diff --git a/cms/djangoapps/contentstore/tests/tests.py b/cms/djangoapps/contentstore/tests/tests.py index 0194ce9f57..f212bc39f1 100644 --- a/cms/djangoapps/contentstore/tests/tests.py +++ b/cms/djangoapps/contentstore/tests/tests.py @@ -6,6 +6,7 @@ This test file will test registration, login, activation, and session activity t import datetime import time from unittest import mock +from urllib.parse import quote_plus from ddt import data, ddt, unpack from django.conf import settings @@ -174,10 +175,11 @@ class AuthTestCase(ContentStoreTestCase): with mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": allow_account_creation}): response = self.client.get(reverse('homepage')) assertion_method = getattr(self, assertion_method_name) + login_url = quote_plus(f"http://testserver{settings.LOGIN_URL}") assertion_method( response, - 'Sign Up'.format - (settings.LMS_ROOT_URL) + f'Sign Up' ) self.assertContains( response, diff --git a/cms/envs/common.py b/cms/envs/common.py index c54416237c..010e045034 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -2686,3 +2686,12 @@ COURSE_LIVE_HELP_URL = "https://edx.readthedocs.io/projects/edx-partner-course-s COURSE_LIVE_GLOBAL_CREDENTIALS = {} PERSONALIZED_RECOMMENDATION_COOKIE_NAME = 'edx-user-personalized-recommendation' + +######################## Registration ######################## + +# Social-core setting that allows inactive users to be able to +# log in. The only case it's used is when user registering a new account through the LMS. +INACTIVE_USER_LOGIN = True + +# Redirect URL for inactive user. If not set, user will be redirected to /login after the login itself (loop) +INACTIVE_USER_URL = f'http://{CMS_BASE}' diff --git a/cms/envs/production.py b/cms/envs/production.py index 17947f353f..ece9b85a17 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -648,3 +648,5 @@ COURSE_LIVE_GLOBAL_CREDENTIALS["BIG_BLUE_BUTTON"] = { "SECRET": ENV_TOKENS.get('BIG_BLUE_BUTTON_GLOBAL_SECRET', None), "URL": ENV_TOKENS.get('BIG_BLUE_BUTTON_GLOBAL_URL', None), } + +INACTIVE_USER_URL = f'http{"s" if HTTPS == "on" else ""}://{CMS_BASE}' diff --git a/cms/templates/howitworks.html b/cms/templates/howitworks.html index 014ad2798d..b04a207eba 100644 --- a/cms/templates/howitworks.html +++ b/cms/templates/howitworks.html @@ -5,6 +5,7 @@ <%! from django.conf import settings from django.utils.translation import gettext as _ + from urllib.parse import quote_plus from openedx.core.djangolib.markup import HTML, Text %> @@ -162,7 +163,7 @@