Python, Django, Django Rest Framework, Backend, Programming.
max_otp_try = int(user_.max_otp_try) - 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 =