mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-16 18:36:18 +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
|
||||
)
|
||||
|
@ -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