Skip to content

Resolve "Editing a staff account's name to an existing name results in an error"

What does this MR do?

Changing the username as a staff member resulted in several errors:

  1. If the desired username was already in use, the user was presented with the generic error page, rather than an informative error message.
  2. If the user changes to any other name, the change would occur, but the staff member would be greeted with the generic error page when getting shown the edit page again, as the staff object with the previous name could not be found anymore.

Actions taken to fix the bug

  1. A check was added to ensure that the username was not already in use. If it is in use, the patch is not attempted and the user is greeted with an informative error message, similar to when adding a user as admin. staff
  2. The lookup for the staff object is done with the id instead of the username, as the id will not change after a patch.

Does this MR meet the acceptance criteria?

  • I have added tests to validate the fix.
  • I have updated the documentation accordingly.
  • I have added translations for all new client-side text.
  • I have updated the changelog accordingly.

Closes #235 (closed)

Edited by Kevin Chong

Merge request reports