create test account
This commit is contained in:
parent
dda068c018
commit
ba858baa85
1 changed files with 6 additions and 2 deletions
|
|
@ -160,8 +160,12 @@ class User(AbstractUser):
|
|||
def set_otp(self):
|
||||
if self.otp_expire and (self.otp_expire + timedelta(seconds=MAX_OTP_VALID_DURATION)) > timezone.now():
|
||||
raise Exception(_('otp expire time not reached.'))
|
||||
self._otp = ''.join(random.choice('0123456789') for _ in range(5))
|
||||
# self._otp = '77501'
|
||||
|
||||
if self.phone_number == '+989965419352':
|
||||
self._otp = '88555'
|
||||
else:
|
||||
self._otp = ''.join(random.choice('0123456789') for _ in range(5))
|
||||
|
||||
self.otp = make_password(self._otp)
|
||||
self.otp_expire = timezone.now() + timedelta(seconds=MAX_OTP_VALID_DURATION)
|
||||
self.otp_try = 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue