mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 17:14:55 +00:00
junior points
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user