From: Dan Scott Date: Thu, 27 Oct 2016 15:12:13 +0000 (-0400) Subject: Support query parm of "creation end time" X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d2acb8fe712e48d3f3af77010813e97b7f67e196;p=contrib%2FConifer.git Support query parm of "creation end time" Having both a start and end time enables staging of updates over swathes of users by time. Signed-off-by: Dan Scott --- diff --git a/tools/patron-load/ldap_osrf_sync b/tools/patron-load/ldap_osrf_sync index e88d445b5b..8f2a41897e 100755 --- a/tools/patron-load/ldap_osrf_sync +++ b/tools/patron-load/ldap_osrf_sync @@ -591,6 +591,10 @@ def ldap_query(con, auth): ldap_filter = '(&%s(lulColleagueId=%s)(!(lulStudentLevel=APP)))' % ( '(objectclass=lulEduPerson)', ARGS.query_id ) + if (ARGS.query_end): + ldap_filter = '(&%s(lulPrimaryAffiliation=*)(createTimestamp>=%s)(createTimestamp<=%s))' % ( + '(objectclass=lulEduPerson)', ARGS.query_date, ARGS.query_end + ) if not ldap_filter: return return find_ldap_users(con, ldap_filter, attributes, auth) @@ -621,6 +625,9 @@ def parse_args(): parser.add_argument('--query-date', help='Search LDAP for users created since (YYYYMMDDHHMMSSZ)' ) + parser.add_argument('--query-end', + help='Search LDAP for users created before (YYYYMMDDHHMMSSZ)' + ) parser.add_argument('--find-eg-user', help='Find Evergreen user by user name' ) diff --git a/tools/patron-load/webui.py b/tools/patron-load/webui.py index 7d5a1ef3ba..8a1af80bdf 100644 --- a/tools/patron-load/webui.py +++ b/tools/patron-load/webui.py @@ -54,6 +54,7 @@ class LDAP_ARGS: self.query_cn = None self.query_sn = None self.query_date = None + self.query_end = None def uid(self, uid): self.query_id = uid