mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 21:59:40 +00:00
otp, verify otp and login bug resolved
This commit is contained in:
@ -155,9 +155,9 @@ class AdminLoginSerializer(serializers.ModelSerializer):
|
||||
).only('id', 'first_name', 'last_name', 'email', 'is_superuser').first()
|
||||
|
||||
if not user:
|
||||
raise serializers.ValidationError({'details': ERROR_CODE['2063']})
|
||||
raise serializers.ValidationError({'details': ERROR_CODE['2002']})
|
||||
elif not user.check_password(attrs['password']):
|
||||
raise serializers.ValidationError({'details': ERROR_CODE['2031']})
|
||||
raise serializers.ValidationError({'details': ERROR_CODE['2002']})
|
||||
self.context.update({'user': user})
|
||||
return attrs
|
||||
|
||||
|
@ -335,9 +335,9 @@ class UserLogin(viewsets.ViewSet):
|
||||
).only('id', 'first_name', 'last_name', 'email', 'is_superuser').first()
|
||||
|
||||
if not user:
|
||||
return custom_error_response(ERROR_CODE["2063"], response_status=status.HTTP_400_BAD_REQUEST)
|
||||
return custom_error_response(ERROR_CODE["2002"], response_status=status.HTTP_400_BAD_REQUEST)
|
||||
elif not user.check_password(password):
|
||||
return custom_error_response(ERROR_CODE["2031"], response_status=status.HTTP_400_BAD_REQUEST)
|
||||
return custom_error_response(ERROR_CODE["2002"], response_status=status.HTTP_400_BAD_REQUEST)
|
||||
serializer = SuperUserSerializer(user)
|
||||
return custom_response(SUCCESS_CODE['3003'], serializer.data, response_status=status.HTTP_200_OK)
|
||||
|
||||
|
Reference in New Issue
Block a user