From e9bf93da4aba3a4f398b436b739366e9588a34be Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 24 Nov 2023 00:13:41 +0800 Subject: [PATCH] Fixed landmarks not being properly saved on study group creation --- stude/study_groups/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stude/study_groups/serializers.py b/stude/study_groups/serializers.py index c420932..dd65ef7 100644 --- a/stude/study_groups/serializers.py +++ b/stude/study_groups/serializers.py @@ -101,6 +101,8 @@ class StudyGroupCreateSerializer(serializers.ModelSerializer): for landmark in Landmark.objects.all(): if landmark.location.contains(validated_data['location']): validated_data['landmark'] = landmark + study_group.landmark = landmark + study_group.save() break validated_data['location'].read_only = True return study_group