Skip to content

Commit

Permalink
update new affiliated institution behavior and remove legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Oct 12, 2023
1 parent b032af0 commit 994d7ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/nodes/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,8 +1618,9 @@ def create(self, validated_data):
if registration_responses:
self.update_registration_responses(draft, registration_responses)

if affiliate_user_institutions and draft.branched_from_type == DraftNode:
draft.affiliated_institutions.set(draft.creator.affiliated_institutions.all())
if affiliate_user_institutions and isinstance(draft.branched_from, DraftNode):
for institution in draft.creator.affiliated_institutions.all():
draft.add_or_update_affiliated_institution(institution)

return draft

Expand Down

0 comments on commit 994d7ab

Please sign in to comment.