mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-20 08:38:01 +02:00
All ASCII characters are allowed in a sub, we change the sub validator to reflect this.
10 lines
282 B
Python
10 lines
282 B
Python
"""Custom validators for the core app."""
|
|
|
|
from django.core.exceptions import ValidationError
|
|
|
|
|
|
def sub_validator(value):
|
|
"""Validate that the sub is ASCII only."""
|
|
if not value.isascii():
|
|
raise ValidationError("Enter a valid sub. This value should be ASCII only.")
|