From d1244296f8bc25286a8fad27b3312132141a91f8 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Tue, 19 Dec 2023 18:48:00 +0800 Subject: [PATCH] Hotfix for study groups radius --- stude/study_groups/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stude/study_groups/views.py b/stude/study_groups/views.py index 14c0699..2ac1632 100644 --- a/stude/study_groups/views.py +++ b/stude/study_groups/views.py @@ -119,6 +119,10 @@ class StudyGroupListNearView(generics.ListAPIView): # Now fetch the StudyGroups with the matching Subject models that are within 100m studygroups = StudyGroup.objects.filter(subject__in=user_subjects).annotate( distance=Distance('location', user_location)).filter(distance__lte=100) + + for group in studygroups: + # Annotate the group with the radius + group.radius = 30 return studygroups