Alumni (from DN) trumps all else
authorDan Scott <dscott@laurentian.ca>
Wed, 7 Oct 2015 21:17:15 +0000 (17:17 -0400)
committerDan Scott <dscott@laurentian.ca>
Wed, 7 Oct 2015 21:17:15 +0000 (17:17 -0400)
We need to reflect Alumni status, which comes only from the DN, rather
than from the primary affiliation, etc, so trump everything else with
that.

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

index 260be80..ed3243b 100755 (executable)
@@ -170,7 +170,9 @@ class User:
         Map LDAP record to Evergreen profile
         """
 
-        if 'lulStudentLevel' in self.ldap_atts:
+        if 'alumni' in self.cname.lower():
+            affiliation = 'alumni'
+        elif 'lulStudentLevel' in self.ldap_atts:
             affiliation = self._simple_map('lulStudentLevel').lower()
         elif 'lulPrimaryAffiliation' in self.ldap_atts:
             affiliation = self._simple_map('lulPrimaryAffiliation').lower()