Handle new 'Proxy' lulAffiliation a bit more gracefully
authorDan Scott <dan@coffeecode.net>
Mon, 12 Sep 2011 21:27:46 +0000 (17:27 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 7 May 2013 18:50:38 +0000 (14:50 -0400)
In general, if we don't have an explicit profile, just return.

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

index 420936a..3601958 100644 (file)
@@ -156,6 +156,9 @@ class User:
             return 11
         elif affiliation == 'staff':
             return 15
+        elif affiliation == 'proxy':
+            return None
+        return None
 
     def get_home_ou(self):
         """
@@ -433,6 +436,10 @@ def create_evergreen_user(auth, result_data):
     if not user:
         return
 
+    if user.profile is None:
+        print >> sys.stderr, "No profile set for %s" % user.usrname
+        return
+
     found = find_evergreen_user(auth, user)
     if found:
         print("Found: %s" % user.usrname)