You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2022/05/17 16:18:31 UTC

[airavata-django-portal] 02/02: AIRAVATA-3565 Fix updating field choice

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch AIRAVATA-3562
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 1759716e74d29a8e5e4d2bf657ea20a715ba3bb9
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue May 17 12:18:18 2022 -0400

    AIRAVATA-3565 Fix updating field choice
---
 django_airavata/apps/auth/serializers.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/django_airavata/apps/auth/serializers.py b/django_airavata/apps/auth/serializers.py
index 1b752362..148e93d1 100644
--- a/django_airavata/apps/auth/serializers.py
+++ b/django_airavata/apps/auth/serializers.py
@@ -188,7 +188,7 @@ class ExtendedUserProfileFieldSerializer(serializers.ModelSerializer):
                     choice_id = choice.pop('id', None)
                     models.ExtendedUserProfileSingleChoiceFieldChoice.objects.update_or_create(
                         id=choice_id,
-                        defaults=choice,
+                        defaults={**choice, "single_choice_field": instance.single_choice},
                     )
             instance.single_choice.save()
         elif instance.field_type == 'multi_choice':
@@ -202,7 +202,7 @@ class ExtendedUserProfileFieldSerializer(serializers.ModelSerializer):
                     choice_id = choice.pop('id', None)
                     models.ExtendedUserProfileMultiChoiceFieldChoice.objects.update_or_create(
                         id=choice_id,
-                        defaults=choice,
+                        defaults={**choice, "multi_choice_field": instance.multi_choice},
                     )
             instance.multi_choice.save()
         elif instance.field_type == 'user_agreement':