mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-17 23:37:47 +02:00
11 lines
319 B
Python
11 lines
319 B
Python
from django.utils.translation import gettext_lazy as _
|
|
from django.core.exceptions import ValidationError
|
|
import validators
|
|
|
|
def validate_domain(value):
|
|
if not validators.domain(value):
|
|
raise ValidationError(
|
|
_('%(value)s is not a valid domain Name'),
|
|
params={'value': value},
|
|
)
|