Duplicate username detection can false positive on the current user

Bug #1246836 reported by Jeff Godin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.5
Fix Released
Medium
Unassigned

Bug Description

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.

Working branch to follow.

Revision history for this message
Jeff Godin (jgodin) wrote :
tags: added: pullrequest
Changed in evergreen:
assignee: Jeff Godin (jgodin) → nobody
Jeff Godin (jgodin)
Changed in evergreen:
milestone: none → 2.5.2
status: New → In Progress
importance: Undecided → Medium
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.2 → 2.6.0-alpha1
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.6.0-alpha1 → 2.6.0-beta1
status: In Progress → Confirmed
Revision history for this message
Ben Shum (bshum) wrote :

Works for me. Thanks Jeff!

I've picked this change to master, rel_2_5, and rel_2_4 with one minor modification (changed the git commit from "dup" to "duplicate")

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
no longer affects: evergreen/2.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.