Hotfix for study groups radius

This commit is contained in:
Keannu Bernasol 2023-12-19 18:48:00 +08:00
parent 1b3207d86b
commit d1244296f8

View file

@ -119,6 +119,10 @@ class StudyGroupListNearView(generics.ListAPIView):
# Now fetch the StudyGroups with the matching Subject models that are within 100m # Now fetch the StudyGroups with the matching Subject models that are within 100m
studygroups = StudyGroup.objects.filter(subject__in=user_subjects).annotate( studygroups = StudyGroup.objects.filter(subject__in=user_subjects).annotate(
distance=Distance('location', user_location)).filter(distance__lte=100) distance=Distance('location', user_location)).filter(distance__lte=100)
for group in studygroups:
# Annotate the group with the radius
group.radius = 30
return studygroups return studygroups