Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use theme for account settings #195

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading