File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,10 +139,26 @@ def get_individuals_for_primary_organization(self,
139139
140140 return individuals
141141
142+ # get_stars_liaison_for_organization doesn't belong here. It should
143+ # live in some AASHE-specific place, not in OrganizationService.
142144 def get_stars_liaison_for_organization (self , organization ):
145+
143146 candidates = self .get_individuals_for_primary_organization (
144147 organization = organization )
148+
149+ # Check for a STARS Primary Contact first:
145150 for candidate in candidates :
146151 if "StarsPrimaryContact__rt" in candidate .fields :
147152 return candidate
153+
154+ # No STARS Primary Contact? Try the account's primary contact:
155+ for candidate in candidates :
156+ if "Primary_Contact__rt" in candidate .fields :
157+ return candidate
158+
159+ # No primary contact? Try billing contact:
160+ for candidate in candidates :
161+ if "Billing_Contact__rt" in candidate .fields :
162+ return candidate
163+
148164 return None
Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ def logout(client):
8282 raise LogoutError (result = result )
8383
8484
85+ # get_user_for_membersuite_entity introduces a dependency on
86+ # Django (django.contrib.auth.models, to be precise). That's
87+ # quite a drag. Goes someplace else. Need to drop dependency
88+ # on Django.
8589def get_user_for_membersuite_entity (membersuite_entity ):
8690 """Returns a User for `membersuite_entity`.
8791
You can’t perform that action at this time.
0 commit comments