12 lines
340 B
Python
12 lines
340 B
Python
from django.core.validators import RegexValidator
|
|
from django.utils.deconstruct import deconstructible
|
|
|
|
|
|
@deconstructible
|
|
class PhoneNumberValidator(RegexValidator):
|
|
regex = r"^\+?1?\d{9,15}$"
|
|
message = (
|
|
"Telefonnummer muss in diesem Format +999999999999 eingegeben werden. Bis zu 15 Zahlen "
|
|
"sind erlaubt."
|
|
)
|