Browse Source

fix: handle exceptions when sending email in UserRegisterView

master
nwhco 10 months ago
parent
commit
d43651591c
  1. 6
      apps/account/views/user.py

6
apps/account/views/user.py

@ -132,8 +132,10 @@ class UserRegisterView(CreateAPIView):
logger.info(f"phone= {data['email']}")
print(f'send {code}/{data["email"]}')
phone_number = RedisManager().add_to_redis(code, **data)
send_email([data['email']], code)
try:
send_email([data['email']], code)
except Exception as exp:
print(f'-exp-register-->{exp}')
return Response(
data= {
"user": data,

Loading…
Cancel
Save