diff --git a/stude/config/settings.py b/stude/config/settings.py index da4be57..450d3f2 100644 --- a/stude/config/settings.py +++ b/stude/config/settings.py @@ -235,8 +235,8 @@ else: SITE_NAME = 'Stud-E' SIMPLE_JWT = { - "ACCESS_TOKEN_LIFETIME": timedelta(minutes=360), - "REFRESH_TOKEN_LIFETIME": timedelta(minutes=360) + "ACCESS_TOKEN_LIFETIME": timedelta(minutes=3600), + "REFRESH_TOKEN_LIFETIME": timedelta(minutes=3600) } LEAFLET_CONFIG = { diff --git a/stude/student_status/serializers.py b/stude/student_status/serializers.py index 5765c55..26c2a97 100644 --- a/stude/student_status/serializers.py +++ b/stude/student_status/serializers.py @@ -39,7 +39,7 @@ class StudentStatusSerializer(serializers.ModelSerializer): validated_data['location'] = Point(0, 0) validated_data['subject'] = None validated_data['landmark'] = None - validated_data['study_group'] = None + validated_data['study_group'] = [] else: if 'subject' not in validated_data: raise serializers.ValidationError( diff --git a/stude/student_status/views.py b/stude/student_status/views.py index b7aa8fe..a563f7f 100644 --- a/stude/student_status/views.py +++ b/stude/student_status/views.py @@ -42,7 +42,7 @@ class StudentStatusListByStudentStatusLocation(generics.ListAPIView): user_location = fromstr( user_status.location, srid=4326) - return StudentStatus.objects.filter(subject__in=user.subjects.all()).annotate(distance=Distance('location', user_location)).filter(distance__lte=50) + return StudentStatus.objects.filter(user != user).filter(subject__in=user.subjects.all()).annotate(distance=Distance('location', user_location)).filter(distance__lte=50) class StudentStatusListByCurrentLocation(viewsets.ViewSet): @@ -57,7 +57,7 @@ class StudentStatusListByCurrentLocation(viewsets.ViewSet): raise exceptions.ValidationError("Location is required") user_location = fromstr(location_str, srid=4326) - queryset = StudentStatus.objects.filter(subject__in=user.subjects.all()).annotate( + queryset = StudentStatus.objects.filter(user != user).filter(subject__in=user.subjects.all()).annotate( distance=Distance('location', user_location)).filter(distance__lte=50) serializer = StudentStatusLocationSerializer(queryset, many=True) return Response(serializer.data)