From 4d24257f741672b6936d6774061ea7aa4ffa0071 Mon Sep 17 00:00:00 2001 From: Johan Seto K <51926076+johanseto@users.noreply.github.com> Date: Fri, 26 Jan 2024 11:04:39 -0500 Subject: [PATCH] fix: test with pr suggestion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrey CaƱon --- .../djangoapps/user_api/accounts/settings_views.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openedx/core/djangoapps/user_api/accounts/settings_views.py b/openedx/core/djangoapps/user_api/accounts/settings_views.py index 6b957c2e4a1b..acf83d0c0363 100644 --- a/openedx/core/djangoapps/user_api/accounts/settings_views.py +++ b/openedx/core/djangoapps/user_api/accounts/settings_views.py @@ -272,12 +272,14 @@ def _get_extended_profile_fields(): "specialty": _("Specialty") } request = theming_helpers.get_current_request() - extended_profile_fields_translations = configuration_helpers.get_value( - 'extended_profile_fields_translations', - {}, - ) - translations = extended_profile_fields_translations.get(request.LANGUAGE_CODE, {}) - field_labels_map.update(translations) + + if request: + extended_profile_fields_translations = configuration_helpers.get_value( + 'extended_profile_fields_translations', + {}, + ) + translations = extended_profile_fields_translations.get(request.LANGUAGE_CODE, {}) + field_labels_map.update(translations) extended_profile_field_names = configuration_helpers.get_value('extended_profile_fields', []) for field_to_exclude in fields_already_showing: