mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-16 10:26:16 +00:00
otp, verify otp and login bug resolved
This commit is contained in:
@ -33,7 +33,7 @@ class ForgotAndResetPasswordViewSet(GenericViewSet):
|
||||
if serializer.is_valid():
|
||||
serializer.save()
|
||||
return custom_response(SUCCESS_CODE['3015'])
|
||||
return custom_error_response(ERROR_CODE['2063'], status.HTTP_400_BAD_REQUEST)
|
||||
return custom_error_response(ERROR_CODE['2000'], status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
@action(methods=['post'], url_name='verify-otp', url_path='verify-otp',
|
||||
detail=False, serializer_class=AdminVerifyOTPSerializer)
|
||||
@ -45,7 +45,7 @@ class ForgotAndResetPasswordViewSet(GenericViewSet):
|
||||
serializer = self.serializer_class(data=request.data)
|
||||
if serializer.is_valid():
|
||||
return custom_response(SUCCESS_CODE['3011'])
|
||||
return custom_error_response(ERROR_CODE['2063'], status.HTTP_400_BAD_REQUEST)
|
||||
return custom_error_response(ERROR_CODE['2008'], status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
@action(methods=['post'], url_name='create-password', url_path='create-password',
|
||||
detail=False, serializer_class=AdminCreatePasswordSerializer)
|
||||
@ -59,5 +59,5 @@ class ForgotAndResetPasswordViewSet(GenericViewSet):
|
||||
user = USER.objects.filter(email=serializer.validated_data.get('email')).first()
|
||||
user.set_password(serializer.validated_data.get('new_password'))
|
||||
user.save()
|
||||
return custom_response(SUCCESS_CODE['3007'])
|
||||
return custom_response(SUCCESS_CODE['3006'])
|
||||
return custom_error_response(ERROR_CODE['2064'], status.HTTP_400_BAD_REQUEST)
|
||||
|
Reference in New Issue
Block a user