This commit is contained in:
Parsa Nazer
2024-12-15 21:09:34 +03:30
parent fe8c391fb1
commit 4bb7f25228
4 changed files with 46 additions and 14 deletions
+2 -2
View File
@@ -28,8 +28,8 @@ class SendOTPView(APIView):
user, created = User.objects.get_or_create(phone=phone)
print(created)
print(user.phone)
user.set_otp()
message = f"کد یک بار مصرف : {user.otp}"
otp = user.set_otp()
message = f"کد یک بار مصرف : {otp}"
print(message)
# send otp
return Response({'detail': 'OTP sent successfully'}, status=status.HTTP_200_OK)