From 01dbcf059439d6d5a5ee86c6944799b56988f063 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 23 Mar 2016 21:21:12 -0400 Subject: [PATCH] LP#1564685 Avoid dupe usrname warning on matching patron Do not treat usernames as duplicates when they belong to the patron being edited. Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier Signed-off-by: Galen Charlton --- .../web/js/ui/default/staff/circ/patron/regctl.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index ae7838ed50..c68a20dae5 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -125,6 +125,16 @@ angular.module('egCoreMod') } service.check_dupe_username = function(usrname) { + + // empty usernames can't be dupes + if (!usrname) return $q.when(false); + + // avoid dupe check if username matches the originally loaded usrname + if (service.existing_patron) { + if (usrname == service.existing_patron.usrname()) + return $q.when(false); + } + return egCore.net.request( 'open-ils.actor', 'open-ils.actor.username.exists', @@ -573,6 +583,8 @@ angular.module('egCoreMod') */ service.init_existing_patron = function(current) { + service.existing_patron = current; + var patron = egCore.idl.toHash(current); patron.home_ou = egCore.org.get(patron.home_ou.id); -- 2.43.2