mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-16 22:09:25 +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():
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue