diff --git a/.github/workflows/check-for-tutorial-prs.yml b/.github/workflows/check-for-tutorial-prs.yml new file mode 100644 index 000000000000..6920542ac187 --- /dev/null +++ b/.github/workflows/check-for-tutorial-prs.yml @@ -0,0 +1,35 @@ +# This workflow detects PRs that make changes to lms/templates/dashboard.html +# and only lms/templates/dashboard.html. This is the file that users are +# guided through changing in the Open edX tutorial: +# https://docs.openedx.org/en/latest/developers/quickstarts/first_openedx_pr.html#exercise-update-the-learner-dashboard + +# If this is the only file changed in the PR, we comment on the PR congratulating +# the user and letting others know that this is not a community PR in need of +# review. CODEOWNERS will tag a triaging team to provide reviews & ultimately +# close the PR. + +name: Check for Tutorial PR +description: Welcome contributors making their first PR from the tutorial +on: + pull_request: + types: [opened] + paths: + - 'lms/templates/dashboard.html' + +jobs: + # Provide helpful bot comment + comment: + runs-on: ubuntu-latest + name: provide helpful bot comment + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Comment PR + uses: thollander/actions-comment-pull-request@v1 + with: + message: | + Thank you for your pull request! Congratulations on completing the Open edX tutorial! A team member will be by to take a look shortly. + To those watching community pull requests: No need to worry about this one, a tCRIL team member will be taking care of it. + For this PR's author: If this is a PR that is NOT coming from the Open edX tutorial, please comment and let us know to disregard this message. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/cms/djangoapps/contentstore/signals/handlers.py b/cms/djangoapps/contentstore/signals/handlers.py index 62efb6019835..44bfdea32908 100644 --- a/cms/djangoapps/contentstore/signals/handlers.py +++ b/cms/djangoapps/contentstore/signals/handlers.py @@ -11,7 +11,7 @@ from django.db import transaction from django.dispatch import receiver from edx_toggles.toggles import SettingToggle -from edx_event_bus_kafka.publishing.event_producer import send_to_event_bus +from edx_event_bus_kafka import get_producer from opaque_keys.edx.keys import CourseKey from openedx_events.content_authoring.data import CourseCatalogData, CourseScheduleData from openedx_events.content_authoring.signals import COURSE_CATALOG_INFO_CHANGED @@ -156,9 +156,9 @@ def listen_for_course_catalog_info_changed(sender, signal, **kwargs): """ Publish COURSE_CATALOG_INFO_CHANGED signals onto the event bus. """ - send_to_event_bus( + get_producer().send( signal=COURSE_CATALOG_INFO_CHANGED, topic='course-catalog-info-changed', - event_key_field='catalog_info.course_key', event_data={'catalog_info': kwargs['catalog_info']} + event_key_field='catalog_info.course_key', event_data={'catalog_info': kwargs['catalog_info']}, ) diff --git a/cms/djangoapps/contentstore/tests/tests.py b/cms/djangoapps/contentstore/tests/tests.py index 0194ce9f5721..f212bc39f1d8 100644 --- a/cms/djangoapps/contentstore/tests/tests.py +++ b/cms/djangoapps/contentstore/tests/tests.py @@ -6,6 +6,7 @@ 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 @@ def test_signin_and_signup_buttons_index_page(self, allow_account_creation, asse 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 c54416237c03..010e045034ff 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -2686,3 +2686,12 @@ 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 17947f353fcb..ece9b85a178e 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -648,3 +648,5 @@ def get_env_setting(setting): "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/static/sass/views/_dashboard.scss b/cms/static/sass/views/_dashboard.scss index 27e62c0c6e6d..3e5a42937892 100644 --- a/cms/static/sass/views/_dashboard.scss +++ b/cms/static/sass/views/_dashboard.scss @@ -151,6 +151,7 @@ .action-primary { @extend %btn-primary-blue; @extend %t-action3; + color: $white; } // specific - request button diff --git a/cms/templates/howitworks.html b/cms/templates/howitworks.html index 014ad2798dbe..b04a207eba6f 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 @@

${_("Sign Up for {studio_name} Today!").format(studio_name=settin