Use the new opt_in_override method to search for users
authorDan Scott <dscott@laurentian.ca>
Wed, 14 Sep 2011 20:03:08 +0000 (16:03 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 7 May 2013 18:57:05 +0000 (14:57 -0400)
Now that we have the opt_in_override method, use it to find users who
might exist in any OU in the consortium, rather than just the
workstation OU.

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

index 8722e33..a79b405 100755 (executable)
@@ -346,6 +346,8 @@ def find_evergreen_user(auth, user):
     Returns user ID if found, None if not
     """
 
+    # Custom search method - overrides opt-in visibility, as it suggests
+    search_method = 'open-ils.actor.patron.search.advanced.opt_in_override'
     limit = 1
     sort = None
     search_depth = 1
@@ -356,7 +358,7 @@ def find_evergreen_user(auth, user):
     )
 
     by_id = osrf_request(
-        'open-ils.actor', 'open-ils.actor.patron.search.advanced',
+        'open-ils.actor', search_method,
         auth, {'ident_value': {'value': user.ident_value, 'group': 0}}, limit,
         sort, include_inactive, search_depth
     ).send()
@@ -365,7 +367,7 @@ def find_evergreen_user(auth, user):
         return by_id[0]
 
     by_email = osrf_request(
-        'open-ils.actor', 'open-ils.actor.patron.search.advanced',
+        'open-ils.actor', search_method,
         auth, {'email': {'value': user.email}}, limit,
         sort, include_inactive, search_depth
     ).send()
@@ -374,7 +376,7 @@ def find_evergreen_user(auth, user):
         return by_email[0] 
 
     by_usrname = osrf_request(
-        'open-ils.actor', 'open-ils.actor.patron.search.advanced',
+        'open-ils.actor', search_method,
         auth, {'usrname': {'value': user.usrname}}, limit,
         sort, include_inactive, search_depth
     ).send()