mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-16 02:16:16 +00:00
@ -72,6 +72,8 @@ class ResetPasswordSerializer(serializers.Serializer):
|
||||
if user_opt_details:
|
||||
user_details = User.objects.filter(email=user_opt_details.email).last()
|
||||
if user_details:
|
||||
if user_details.check_password(password):
|
||||
raise serializers.ValidationError({"details":ERROR_CODE['2001'],"code":"400", "status":"failed"})
|
||||
user_details.set_password(password)
|
||||
user_details.save()
|
||||
return {'password':password}
|
||||
|
@ -24,7 +24,7 @@ ERROR_CODE_REQUIRED = {
|
||||
# Error code
|
||||
ERROR_CODE = {
|
||||
"2000": "Email not found.",
|
||||
"2001": "Your account has not been verified. Please check your email and verify it.",
|
||||
"2001": "This is your existing password. Please choose other one",
|
||||
"2002": "Invalid login credentials.",
|
||||
"2003": "An account already exists with this email address.",
|
||||
"2004": "User not found.",
|
||||
|
Reference in New Issue
Block a user