mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-17 02:45:08 +00:00
changes in task list API and add special character in password for added junior
This commit is contained in:
@ -136,7 +136,8 @@ class TaskListAPIView(viewsets.ModelViewSet):
|
||||
Params
|
||||
status
|
||||
search
|
||||
page"""
|
||||
page
|
||||
junior"""
|
||||
serializer_class = TaskDetailsSerializer
|
||||
permission_classes = [IsAuthenticated]
|
||||
filter_backends = (SearchFilter,)
|
||||
@ -156,9 +157,17 @@ class TaskListAPIView(viewsets.ModelViewSet):
|
||||
"""Create guardian profile"""
|
||||
status_value = self.request.GET.get('status')
|
||||
current_page = self.request.GET.get('page')
|
||||
junior = self.request.GET.get('junior')
|
||||
queryset = self.get_queryset()
|
||||
if status_value and status_value != '0':
|
||||
queryset = queryset.filter(task_status=status_value)
|
||||
task_status = ['1']
|
||||
if str(status_value) == '2':
|
||||
task_status = ['2', '4']
|
||||
elif str(status_value) == '3':
|
||||
task_status = ['3', '5', '6']
|
||||
if status_value and not junior:
|
||||
queryset = queryset.filter(task_status__in=task_status)
|
||||
elif status_value and junior:
|
||||
queryset = queryset.filter(task_status__in=task_status,junior=int(junior))
|
||||
paginator = self.pagination_class()
|
||||
total_count = len(queryset)
|
||||
total_pages = math.ceil(total_count/10)
|
||||
|
Reference in New Issue
Block a user