Skip to content

Commit

Permalink
chore: use theme for account settings
Browse files Browse the repository at this point in the history
  • Loading branch information
johanseto committed Jul 10, 2024
1 parent 197409a commit 57f22e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion eox_nelp/user_profile/api/v1/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_account_update_error(self, cdd_task_mock):

@override_settings(
ENABLE_OTP_VALIDATION=False,
EXTRA_ACCOUNT_USER_FIELDS=["first_name", "last_name"],
REQUIRED_USER_ACCOUNT_FIELDS=["first_name", "last_name"],
PEARSON_RTI_ACTIVATE_GRADED_GATE=True,
)
@patch("eox_nelp.user_profile.api.v1.views.cdd_task")
Expand Down
4 changes: 2 additions & 2 deletions eox_nelp/user_profile/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ def update_user_data(request):
# so some fields like first_name and last_name are not editable in the standad implementation.
# so some fields related ExtraInfo are not editable in the standad implementation.

extra_account_user_fields = getattr(settings, "EXTRA_ACCOUNT_USER_FIELDS", [])
required_user_account_fields = getattr(settings, "REQUIRED_USER_ACCOUNT_FIELDS", [])
required_user_extra_info_fields = getattr(settings, 'REQUIRED_USER_EXTRA_INFO_FIELDS', [])

for field, value in request.data.items():
if field in extra_account_user_fields and hasattr(request.user, field):
if field in required_user_account_fields and hasattr(request.user, field):
setattr(request.user, field, value)
request.user.save()
if field in required_user_extra_info_fields:
Expand Down

0 comments on commit 57f22e9

Please sign in to comment.