mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-04-05 01:21:33 +08:00
Fixed landmarks not being properly saved on study group creation
This commit is contained in:
parent
832283f029
commit
e9bf93da4a
1 changed files with 2 additions and 0 deletions
|
@ -101,6 +101,8 @@ class StudyGroupCreateSerializer(serializers.ModelSerializer):
|
||||||
for landmark in Landmark.objects.all():
|
for landmark in Landmark.objects.all():
|
||||||
if landmark.location.contains(validated_data['location']):
|
if landmark.location.contains(validated_data['location']):
|
||||||
validated_data['landmark'] = landmark
|
validated_data['landmark'] = landmark
|
||||||
|
study_group.landmark = landmark
|
||||||
|
study_group.save()
|
||||||
break
|
break
|
||||||
validated_data['location'].read_only = True
|
validated_data['location'].read_only = True
|
||||||
return study_group
|
return study_group
|
||||||
|
|
Loading…
Add table
Reference in a new issue