junior points

This commit is contained in:
jain
2023-08-10 12:19:08 +05:30
parent 656f0da89a
commit 7a9be0326a

View File

@ -357,15 +357,11 @@ class JuniorPointsListAPIView(viewsets.ModelViewSet):
permission_classes = [IsAuthenticated]
http_method_names = ('get',)
def get_queryset(self):
"""get queryset"""
update_positions_based_on_points()
return JuniorTask.objects.filter(junior__auth__email=self.request.user).last()
def list(self, request, *args, **kwargs):
"""profile view"""
try:
queryset = self.get_queryset()
update_positions_based_on_points()
queryset = JuniorTask.objects.filter(junior__auth__email=self.request.user).last()
# update position of junior
serializer = JuniorPointsSerializer(queryset)
return custom_response(None, serializer.data, response_status=status.HTTP_200_OK)