create test account

This commit is contained in:
Sayyid Hamid Mahdavi 2026-02-18 12:42:46 +03:30
parent dda068c018
commit ba858baa85

View file

@ -160,8 +160,12 @@ class User(AbstractUser):
def set_otp(self): def set_otp(self):
if self.otp_expire and (self.otp_expire + timedelta(seconds=MAX_OTP_VALID_DURATION)) > timezone.now(): if self.otp_expire and (self.otp_expire + timedelta(seconds=MAX_OTP_VALID_DURATION)) > timezone.now():
raise Exception(_('otp expire time not reached.')) raise Exception(_('otp expire time not reached.'))
if self.phone_number == '+989965419352':
self._otp = '88555'
else:
self._otp = ''.join(random.choice('0123456789') for _ in range(5)) self._otp = ''.join(random.choice('0123456789') for _ in range(5))
# self._otp = '77501'
self.otp = make_password(self._otp) self.otp = make_password(self._otp)
self.otp_expire = timezone.now() + timedelta(seconds=MAX_OTP_VALID_DURATION) self.otp_expire = timezone.now() + timedelta(seconds=MAX_OTP_VALID_DURATION)
self.otp_try = 0 self.otp_try = 0