cleanup
This commit is contained in:
parent
90e8d04813
commit
659de23863
2 changed files with 1 additions and 15 deletions
|
|
@ -15,7 +15,6 @@ from .provinces_and_cities import state
|
||||||
from .tasks import send_notification
|
from .tasks import send_notification
|
||||||
|
|
||||||
from apps.users.constans import MAX_OTP_TRY, DEVELOPMENT_PHONE_NUMBERS
|
from apps.users.constans import MAX_OTP_TRY, DEVELOPMENT_PHONE_NUMBERS
|
||||||
from .validators import PhoneNumberValidator
|
|
||||||
|
|
||||||
|
|
||||||
class UserManager(BaseUserManager):
|
class UserManager(BaseUserManager):
|
||||||
|
|
@ -107,8 +106,7 @@ class User(AbstractUser):
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True
|
null=True
|
||||||
)
|
)
|
||||||
phone_number = models.CharField(_('phone number'), max_length=30, blank=True, null=True, unique=True,
|
phone_number = models.CharField(_('phone number'), max_length=30, blank=True, null=True, unique=True)
|
||||||
validators=[PhoneNumberValidator],)
|
|
||||||
otp = models.CharField(_('otp'), max_length=6, blank=True, null=True)
|
otp = models.CharField(_('otp'), max_length=6, blank=True, null=True)
|
||||||
otp_expire = models.DateTimeField(_('otp expire'), blank=True, null=True)
|
otp_expire = models.DateTimeField(_('otp expire'), blank=True, null=True)
|
||||||
otp_try = models.IntegerField(_('otp try'), blank=True, null=True, default=0)
|
otp_try = models.IntegerField(_('otp try'), blank=True, null=True, default=0)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
from django.core import validators
|
|
||||||
from django.utils.deconstruct import deconstructible
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
@deconstructible
|
|
||||||
class PhoneNumberValidator(validators.RegexValidator):
|
|
||||||
regex = r'^\+98\d{10,10}$'
|
|
||||||
message = _(
|
|
||||||
"Phone number must be entered in the format: '+989999999999'."
|
|
||||||
)
|
|
||||||
flags = 0
|
|
||||||
Loading…
Add table
Reference in a new issue