mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 17:14:55 +00:00
optimized task status code
This commit is contained in:
@ -37,7 +37,7 @@ from .models import Guardian, JuniorTask
|
||||
from junior.models import Junior, JuniorPoints, JuniorGuardianRelationship
|
||||
from account.models import UserEmailOtp, UserNotification, UserDeviceDetails
|
||||
from .tasks import generate_otp
|
||||
from account.utils import custom_response, custom_error_response, OTP_EXPIRY, send_otp_email
|
||||
from account.utils import custom_response, custom_error_response, send_otp_email, task_status_fun
|
||||
from base.messages import ERROR_CODE, SUCCESS_CODE
|
||||
from base.constants import NUMBER, GUARDIAN_CODE_STATUS, GUARDIAN
|
||||
from .utils import upload_image_to_alibaba
|
||||
@ -159,11 +159,7 @@ class TaskListAPIView(viewsets.ModelViewSet):
|
||||
current_page = self.request.GET.get('page')
|
||||
junior = self.request.GET.get('junior')
|
||||
queryset = self.get_queryset()
|
||||
task_status = ['1']
|
||||
if str(status_value) == '2':
|
||||
task_status = ['2', '4']
|
||||
elif str(status_value) == '3':
|
||||
task_status = ['3', '5', '6']
|
||||
task_status = task_status_fun(status_value)
|
||||
if status_value and not junior:
|
||||
queryset = queryset.filter(task_status__in=task_status)
|
||||
elif status_value and junior:
|
||||
|
||||
Reference in New Issue
Block a user