]> git.evergreen-ils.org Git - Evergreen.git/commit
Skip duplicate username check when username unchanged
authorJeff Godin <jgodin@tadl.org>
Wed, 30 Oct 2013 17:20:28 +0000 (13:20 -0400)
committerBen Shum <bshum@biblio.org>
Thu, 6 Feb 2014 06:02:57 +0000 (01:02 -0500)
commit0da485a3469a9a34c6267b6549d8319835bccfc6
tree4bb304191491677b7c8a972fa6bd4e8dc72bbe66
parent657658c642b21b0497d44fa9a087195b8dc5b06f
Skip duplicate username check when username unchanged

Changing a username, then changing back to the user's current
username results in a duplicate username detection -- a false
positive due to the API call finding a user with that username --
the current user. This prevents you from saving any other changes
you may have made to the user.

This can be prevented by skipping the duplicate username check if
the user is not new and the username in the field matches the
username stored in the in-memory Javascript representation of the
user.

There's still a potential corner case which could be avoided by
using a new/modified API call to either accept an "except this
au.id" argument or to return the au.id of the found user, but I
don't see a need for that at this point.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/web/js/ui/default/actor/user/register.js