diff --git a/contact_us/models.py b/contact_us/models.py index f6a8cb2..7676da1 100644 --- a/contact_us/models.py +++ b/contact_us/models.py @@ -44,9 +44,9 @@ class Request(AbstractStatusModel): email = models.EmailField(_('Email')) subject = models.CharField(_('Subject'), max_length=500) message = models.TextField(blank=True, null=True) - phone_regex = RegexValidator(regex=r'^\((+7)|8)?\d{10}$', + phone_regex = RegexValidator(regex=r'^((\+7)|8)?\d{10}$', message="Phone number must be entered in the format: '+99999999999'. Up to 12 digits allowed.") - phone = models.CharField(validators=[phone_regex], max_length=12, blank=True, null=True) + phone = models.CharField(validators=(phone_regex,), max_length=12, blank=True, null=True) status = models.SmallIntegerField(_('Status'), default=REQUEST_DEFAULT_STATUS, choices=REQUEST_STATUS_CHOICES) @property