Fallback to lulAffiliation for affiliation feature/tools/patron_load_2_4
authorDan Scott <dscott@laurentian.ca>
Wed, 14 Sep 2016 17:53:30 +0000 (13:53 -0400)
committerDan Scott <dscott@laurentian.ca>
Wed, 14 Sep 2016 17:53:30 +0000 (13:53 -0400)
Because some older (2011ish) LDAP accounts don't have
lulPrimaryAffiliation attributes.

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

index 95e143e..4724e05 100755 (executable)
@@ -171,6 +171,8 @@ class User:
             affiliation = self._simple_map('lulStudentLevel').lower()
         elif 'lulPrimaryAffiliation' in self.ldap_atts:
             affiliation = self._simple_map('lulPrimaryAffiliation').lower()
+        elif 'lulAffiliation' in self.ldap_atts:
+            affiliation = self._simple_map('lulPrimaryAffiliation').lower()
         else:
             affiliation = r'\N'