From bf683b08f28fb4a1df6daca7a72e137e3e88a591 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 22 Sep 2023 23:11:24 +0800 Subject: [PATCH] Increase filter threshhold for student statuses to 100m --- stude/student_status/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stude/student_status/views.py b/stude/student_status/views.py index fb9d79e..861a0e7 100644 --- a/stude/student_status/views.py +++ b/stude/student_status/views.py @@ -51,9 +51,9 @@ class StudentStatusListByStudentStatusLocation(generics.ListAPIView): # Exclude user # Filter those only with the same subjects as the user # Annotate the queryset with distance to the user - # Then filter so that only those within 50m remain + # Then filter so that only those within 100m remain return StudentStatus.objects.exclude(user=user).filter(active=True).filter( - subject__name__in=user_subject_names).annotate(distance=Distance('location', user_location)).filter(distance__lte=50) + subject__name__in=user_subject_names).annotate(distance=Distance('location', user_location)).filter(distance__lte=100) class StudentStatusListByCurrentLocation(viewsets.ViewSet): @@ -78,8 +78,8 @@ class StudentStatusListByCurrentLocation(viewsets.ViewSet): # Exclude user # Filter those only with the same subjects as the user # Annotate the queryset with distance to the user - # Then filter so that only those within 50m remain + # Then filter so that only those within 100m remain queryset = StudentStatus.objects.exclude(user=user).filter(active=True).filter(subject__name__in=user_subject_names).annotate( - distance=Distance('location', user_location)).filter(distance__lte=50) + distance=Distance('location', user_location)).filter(distance__lte=100) serializer = StudentStatusLocationSerializer(queryset, many=True) return Response(serializer.data)