Python, Django, Django Rest Framework, Backend, Programming.
- 1 user.otp = otp user.otp_expiry = otp_expiry user.max_otp_try = max_otp_try if max_otp_try == 0: otp_max_out = timezone.now() + datetime.timedelta(hours=1) elif max_otp_try == -1: user.max_otp_try = 3 else: user.otp_max_out = None user.max_otp_try = max_otp_try user.save() print(user.otp, 'OTP',