When updating a user, do not reset their password
authorDan Scott <dscott@laurentian.ca>
Mon, 25 Jan 2016 17:33:51 +0000 (12:33 -0500)
committerDan Scott <dscott@laurentian.ca>
Mon, 25 Jan 2016 17:33:51 +0000 (12:33 -0500)
Also, avoid a logic issue where if we have the barcode in hand it
prevented us from syncing the user's attributes.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
tools/patron-load/ldap_osrf_sync

index 75a1c81..0c44e3d 100755 (executable)
@@ -450,9 +450,6 @@ def create_evergreen_user(auth, user):
         print >> sys.stderr, "No profile set for %s" % user.usrname
         return
 
-    if user.barcode is not None:
-        return
-
     found = find_evergreen_user(auth, user)
 
     egau = osrf.net_obj.new_object_from_hint('au')
@@ -473,13 +470,16 @@ def create_evergreen_user(auth, user):
     egau.ident_type(user.ident_type)
     egau.ident_value(user.ident_value)
     egau.home_ou(user.home_ou)
-    egau.passwd(user.passwd)
     egau.expire_date(user.expire_date)
 
     # Workaround open-ils.actor.patron.update bug
     egau.addresses([])
     egau.cards([])
 
+    # Don't reset the Conifer-specific password
+    if not found:
+        egau.passwd(user.passwd)
+
     # Create or update the user
     try:
         usr = osrf_request(