From 27faf23bec78612dd293c1b8d806203e1474f475 Mon Sep 17 00:00:00 2001 From: Sayyid Hamid Mahdavi Date: Sun, 15 Feb 2026 10:24:38 +0330 Subject: [PATCH] random password --- apps/users/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/models.py b/apps/users/models.py index ec4686e..077acf9 100644 --- a/apps/users/models.py +++ b/apps/users/models.py @@ -154,8 +154,8 @@ 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' + self._otp = ''.join(random.choice('0123456789') for _ in range(5)) + # self._otp = '77501' self.otp = make_password(self._otp) self.otp_expire = timezone.now() + timedelta(seconds=MAX_OTP_VALID_DURATION) self.otp_try = 0