From eba70da441b64b9239e614966547e6d64a42f98d Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Fri, 13 Oct 2023 02:44:33 +0800 Subject: [PATCH] update new affiliated institution behavior and remove legacy --- api/nodes/serializers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/nodes/serializers.py b/api/nodes/serializers.py index aaff14ac1b95..4f4dddc4bc5a 100644 --- a/api/nodes/serializers.py +++ b/api/nodes/serializers.py @@ -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.get_institution_affiliations(): + draft.affiliated_institutions.add(*draft.creator.affiliated_institutions.all()) return draft