From: Dan Scott Date: Wed, 14 Sep 2011 20:47:38 +0000 (-0400) Subject: Don't update the barcode if user was not created X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7e95822cc7b886bf9f53ce17cd51a39968b4a53e;p=contrib%2FConifer.git Don't update the barcode if user was not created Check the return value and bail if the user creation was a failure. For large updates, one can use --create and --push to update barcodes for users who already exist. Signed-off-by: Dan Scott --- diff --git a/tools/patron-load/ldap_osrf_sync b/tools/patron-load/ldap_osrf_sync index a79b40536c..2bab8b6bd2 100755 --- a/tools/patron-load/ldap_osrf_sync +++ b/tools/patron-load/ldap_osrf_sync @@ -305,7 +305,8 @@ def find_ldap_users(con, ldap_filter, attributes, auth): dump_data(result_data) if ARGS.create_users: res = create_evergreen_user(auth, user) - update_ldap_barcode(con, user) + if res: + update_ldap_barcode(con, user) if ARGS.push_barcode: try: uid = find_evergreen_user(auth, user) @@ -457,6 +458,7 @@ def create_evergreen_user(auth, user): create_stat_cats(newau, user) print("Created: %s with barcode %s" % (newau.usrname(), user.barcode)) + return user.barcode def update_ldap_barcode(con, user): """