Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions osf/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,7 @@ def add_or_update_affiliated_institution(self, institution, sso_identity=None, s
sso_department=sso_department,
sso_other_attributes={}
)
self.update_search()
return affiliation
# CASE 2: affiliation exists
updated = False
Expand All @@ -1783,6 +1784,7 @@ def add_or_update_affiliated_institution(self, institution, sso_identity=None, s
return None
# CASE 1.3: at least one attribute is updated -> return the affiliation
affiliation.save()
self.update_search()
return affiliation

def remove_sso_identity_from_affiliation(self, institution):
Expand All @@ -1791,6 +1793,7 @@ def remove_sso_identity_from_affiliation(self, institution):
affiliation = InstitutionAffiliation.objects.get(user__id=self.id, institution__id=institution.id)
affiliation.sso_identity = None
affiliation.save()
self.update_search()
return affiliation

def copy_institution_affiliation_when_merging_user(self, user):
Expand Down Expand Up @@ -1832,6 +1835,8 @@ def remove_affiliated_institution(self, institution_id):
group = affiliation.institution.get_group('institutional_admins')
group.user_set.remove(self)
group.save()

self.update_search()
return True

def remove_all_affiliated_institutions(self):
Expand Down
Loading