mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-16 18:36:18 +00:00
email changes
This commit is contained in:
@ -86,7 +86,7 @@ class ForgotPasswordAPIView(views.APIView):
|
||||
return custom_error_response(ERROR_CODE['2004'], response_status=status.HTTP_404_NOT_FOUND)
|
||||
verification_code = ''.join([str(random.randrange(9)) for _ in range(6)])
|
||||
# Send the verification code to the user's email
|
||||
from_email = settings.EMAIL_HOST_USER
|
||||
from_email = settings.EMAIL_FROM_ADDRESS
|
||||
recipient_list = [email]
|
||||
send_templated_mail(
|
||||
template_name='email_reset_verification.email',
|
||||
|
@ -47,7 +47,8 @@ class UserSerializer(serializers.ModelSerializer):
|
||||
otp_verified = False
|
||||
if otp and otp.is_verified:
|
||||
otp_verified = True
|
||||
raise serializers.ValidationError({"details":ERROR_CODE['2021'], "otp_verified":otp_verified, "code": "400", "status":"failed",
|
||||
raise serializers.ValidationError({"details":ERROR_CODE['2021'], "otp_verified":bool(otp_verified),
|
||||
"code": 400, "status":"failed",
|
||||
})
|
||||
|
||||
class CreateGuardianSerializer(serializers.ModelSerializer):
|
||||
|
Reference in New Issue
Block a user