diff --git a/Dockerfile b/Dockerfile index a159d32464..f4eba6fd66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -147,6 +147,9 @@ COPY . . # Install Python requirements again in order to capture local projects RUN pip install -e . +# Setting edx-platform directory as safe for git commands +RUN git config --global --add safe.directory /edx/app/edxapp/edx-platform + # Production target FROM base as production diff --git a/Makefile b/Makefile index 55252bf2af..ff03f36554 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,7 @@ push_translations: ## push source strings to Transifex for translation pull_translations: ## pull translations from Transifex git clean -fdX conf/locale +ifeq ($(OPENEDX_ATLAS_PULL),) i18n_tool transifex pull i18n_tool extract i18n_tool dummy @@ -65,6 +66,12 @@ pull_translations: ## pull translations from Transifex git clean -fdX conf/locale/eo i18n_tool validate --verbose paver i18n_compilejs +else + find conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; + atlas pull $(OPENEDX_ATLAS_ARGS) translations/edx-platform/conf/locale:conf/locale + i18n_tool generate + paver i18n_compilejs +endif detect_changed_source_translations: ## check if translation files are up-to-date diff --git a/lms/djangoapps/discussion/rest_api/api.py b/lms/djangoapps/discussion/rest_api/api.py index 459b9cbc24..d8b02435a4 100644 --- a/lms/djangoapps/discussion/rest_api/api.py +++ b/lms/djangoapps/discussion/rest_api/api.py @@ -38,7 +38,6 @@ from lms.djangoapps.course_blocks.api import get_course_blocks from lms.djangoapps.courseware.courses import get_course_with_access from lms.djangoapps.courseware.exceptions import CourseAccessRedirect from lms.djangoapps.discussion.toggles import ENABLE_DISCUSSIONS_MFE, ENABLE_LEARNERS_TAB_IN_DISCUSSIONS_MFE -from lms.djangoapps.discussion.toggles_utils import reported_content_email_notification_enabled from lms.djangoapps.discussion.views import is_privileged_user from openedx.core.djangoapps.discussions.models import ( DiscussionsConfiguration, @@ -1367,8 +1366,7 @@ def _handle_abuse_flagged_field(form_value, user, cc_content, request): if form_value: cc_content.flagAbuse(user, cc_content) track_discussion_reported_event(request, course, cc_content) - if ENABLE_DISCUSSIONS_MFE.is_enabled(course_key) and reported_content_email_notification_enabled( - course_key): + if ENABLE_DISCUSSIONS_MFE.is_enabled(course_key): if cc_content.type == 'thread': thread_flagged.send(sender='flag_abuse_for_thread', user=user, post=cc_content) else: diff --git a/lms/djangoapps/discussion/tasks.py b/lms/djangoapps/discussion/tasks.py index 7799d95bf2..d483a82dbd 100644 --- a/lms/djangoapps/discussion/tasks.py +++ b/lms/djangoapps/discussion/tasks.py @@ -20,6 +20,7 @@ from opaque_keys.edx.keys import CourseKey from six.moves.urllib.parse import urljoin from lms.djangoapps.discussion.toggles import ENABLE_DISCUSSIONS_MFE +from lms.djangoapps.discussion.toggles_utils import reported_content_email_notification_enabled from openedx.core.djangoapps.discussions.url_helpers import get_discussions_mfe_url from xmodule.modulestore.django import modulestore @@ -98,6 +99,8 @@ def send_ace_message(context): # lint-amnesty, pylint: disable=missing-function def send_ace_message_for_reported_content(context): # lint-amnesty, pylint: disable=missing-function-docstring context['course_id'] = CourseKey.from_string(context['course_id']) context['course_name'] = modulestore().get_course(context['course_id']).display_name + if not reported_content_email_notification_enabled(context['course_id']): + return moderators = get_users_with_moderator_roles(context) context['site'] = Site.objects.get(id=context['site_id']) diff --git a/openedx/core/djangoapps/user_api/accounts/settings_views.py b/openedx/core/djangoapps/user_api/accounts/settings_views.py index 002695d4e3..79e01e0bf0 100644 --- a/openedx/core/djangoapps/user_api/accounts/settings_views.py +++ b/openedx/core/djangoapps/user_api/accounts/settings_views.py @@ -268,7 +268,8 @@ def _get_extended_profile_fields(): platform_name=configuration_helpers.get_value("PLATFORM_NAME", settings.PLATFORM_NAME) ), "profession": _("Profession"), - "specialty": _("Specialty") + "specialty": _("Specialty"), + "work_experience": _("Work experience") } extended_profile_field_names = configuration_helpers.get_value('extended_profile_fields', []) diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py b/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py index b49be866ff..874497664d 100644 --- a/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py +++ b/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py @@ -20,6 +20,7 @@ from openedx.core.djangoapps.lang_pref.tests.test_api import EN, LT_LT from openedx.core.djangoapps.programs.tests.mixins import ProgramsApiConfigMixin from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin +from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration from openedx.core.djangoapps.user_api.accounts.settings_views import account_settings_context, get_user_orders from openedx.core.djangoapps.user_api.accounts.toggles import REDIRECT_TO_ACCOUNT_MICROFRONTEND from openedx.core.djangoapps.user_api.tests.factories import UserPreferenceFactory @@ -108,6 +109,21 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, SiteMixin, ProgramsApiCon expected_beta_language = {'code': 'lt-lt', 'name': settings.LANGUAGE_DICT.get('lt-lt')} assert context['beta_language'] == expected_beta_language + @with_site_configuration( + configuration={ + 'extended_profile_fields': ['work_experience'] + } + ) + def test_context_extended_profile(self): + """ + Test that if the field is available in extended_profile configuration then the field + will be sent in response. + """ + context = account_settings_context(self.request) + extended_pofile_field = context['extended_profile_fields'][0] + assert extended_pofile_field['field_name'] == 'work_experience' + assert extended_pofile_field['field_label'] == 'Work experience' + @mock.patch('openedx.core.djangoapps.user_api.accounts.settings_views.enterprise_customer_for_request') @mock.patch('openedx.features.enterprise_support.utils.third_party_auth.provider.Registry.get') def test_context_for_enterprise_learner( diff --git a/openedx/core/djangoapps/user_authn/api/form_fields.py b/openedx/core/djangoapps/user_authn/api/form_fields.py index 3f60841db2..8bba651f47 100644 --- a/openedx/core/djangoapps/user_authn/api/form_fields.py +++ b/openedx/core/djangoapps/user_authn/api/form_fields.py @@ -364,3 +364,15 @@ def add_confirm_email_field(is_field_required=False): 'label': email_label, 'error_message': accounts.REQUIRED_FIELD_CONFIRM_EMAIL_TEXT_MSG if is_field_required else '', } + + +def add_work_experience_field(is_field_required=False): + """ + Returns the user work experience field description + """ + # Translators: This label appears above a dropdown menu to select + # the user's work experience + work_experience_label = _("Work experience") + return _add_field_with_configurable_select_options( + 'work_experience', work_experience_label, is_field_required, + ) diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 1353b8de8c..0a79796305 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -462,7 +462,7 @@ edx-django-utils==5.9.0 # openedx-blockstore # ora2 # super-csv -edx-drf-extensions==9.0.1 +edx-drf-extensions==9.1.2 # via # -r requirements/edx/kernel.in # edx-completion diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index d8e2ab07f2..df63fe4ee6 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -742,7 +742,7 @@ edx-django-utils==5.9.0 # openedx-blockstore # ora2 # super-csv -edx-drf-extensions==9.0.1 +edx-drf-extensions==9.1.2 # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index e0cd56c34e..4d880f8f9d 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -540,7 +540,7 @@ edx-django-utils==5.9.0 # openedx-blockstore # ora2 # super-csv -edx-drf-extensions==9.0.1 +edx-drf-extensions==9.1.2 # via # -r requirements/edx/base.txt # edx-completion diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index d09f364832..2b321570bd 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -568,7 +568,7 @@ edx-django-utils==5.9.0 # openedx-blockstore # ora2 # super-csv -edx-drf-extensions==9.0.1 +edx-drf-extensions==9.1.2 # via # -r requirements/edx/base.txt # edx-completion