hash otp
This commit is contained in:
parent
2cf5ab4cb7
commit
0d59a34e06
1 changed files with 5 additions and 1 deletions
|
|
@ -70,7 +70,11 @@ class RequestOTPSerializer(serializers.ModelSerializer):
|
|||
user = User.objects.create_user(**validated_data)
|
||||
|
||||
if not user.otp_is_valid():
|
||||
user.set_otp()
|
||||
try:
|
||||
user.set_otp()
|
||||
except Exception as e:
|
||||
raise UnprocessableEntity()
|
||||
|
||||
user.save()
|
||||
user.send_otp()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue