mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +00:00
@ -322,7 +322,7 @@ class ForgotPasswordAPIView(views.APIView):
|
||||
send_all_email.delay(
|
||||
'email_reset_verification.email', email, verification_code
|
||||
)
|
||||
expiry = OTP_EXPIRY
|
||||
expiry = timezone.now() + timezone.timedelta(days=1)
|
||||
user_data, created = UserEmailOtp.objects.get_or_create(
|
||||
email=email
|
||||
)
|
||||
|
@ -219,7 +219,7 @@ class AddJuniorAPIView(viewsets.ModelViewSet):
|
||||
return False
|
||||
if not junior.guardian_code:
|
||||
junior.guardian_code = [guardian.guardian_code]
|
||||
if type(junior.guardian_code) is list and len(junior.guardian_code) < 3:
|
||||
elif type(junior.guardian_code) is list and len(junior.guardian_code) < 3:
|
||||
junior.guardian_code.append(guardian.guardian_code)
|
||||
else:
|
||||
return "Max"
|
||||
@ -595,8 +595,8 @@ class StartAssessmentAPIView(viewsets.ModelViewSet):
|
||||
article_id = self.request.GET.get('article_id')
|
||||
# if referral_code:
|
||||
article = Article.objects.filter(id=article_id, is_deleted=False).prefetch_related(
|
||||
'article_cards', 'article_survey', 'article_survey__options'
|
||||
).order_by('-created_at')
|
||||
'article_survey'
|
||||
)
|
||||
return article
|
||||
def list(self, request, *args, **kwargs):
|
||||
"""Params
|
||||
|
@ -306,8 +306,9 @@ class StartAssessmentSerializer(serializers.ModelSerializer):
|
||||
"""current page"""
|
||||
context_data = self.context.get('user')
|
||||
data = JuniorArticle.objects.filter(junior__auth=context_data, article=obj).last()
|
||||
total_count = obj.article_survey.all().count()
|
||||
if data:
|
||||
return data.current_que_page
|
||||
return data.current_que_page if data.current_que_page < total_count else data.current_que_page - 1
|
||||
return NUMBER['zero']
|
||||
class Meta(object):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user