Skip to content

Commit

Permalink
check if the field the user wants to change is indeed in the FIELD_VA…
Browse files Browse the repository at this point in the history
…LIDATORS ( aka in the field the user is authorized to change)
  • Loading branch information
a-levra committed Mar 12, 2024
1 parent 55c40cc commit 0c6f814
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions user_management/src/user/views/update_infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def update_infos(user_id, json_request):
return False, errors

for field in change_list:
if field not in UserUpdateInfosManager.FIELD_VALIDATORS.keys():
errors.append(f'Field {field} is not valid')
return False, errors
value = json_request.get(field)
success, update_errors = UserUpdateInfosManager.update_user_field(user_id, field, value)
if not success:
Expand Down

0 comments on commit 0c6f814

Please sign in to comment.