fabro/nodes/solve/diff.patch
Fabro ce45e9a59a checkpoint
⚒️ Generated with [Fabro](https://fabro.sh)
2026-03-16 08:07:16 -04:00

32 lines
940 B
Diff

diff --git a/django/contrib/auth/validators.py b/django/contrib/auth/validators.py
new file mode 100644
index 0000000..74e31f5
--- /dev/null
+++ b/django/contrib/auth/validators.py
@@ -0,0 +1,25 @@
+import re
+
+from django.core import validators
+from django.utils.deconstruct import deconstructible
+from django.utils.translation import gettext_lazy as _
+
+
+@deconstructible
+class ASCIIUsernameValidator(validators.RegexValidator):
+ regex = r'\A[\w.@+-]+\Z'
+ message = _(
+ 'Enter a valid username. This value may contain only English letters, '
+ 'numbers, and @/./+/-/_ characters.'
+ )
+ flags = re.ASCII
+
+
+@deconstructible
+class UnicodeUsernameValidator(validators.RegexValidator):
+ regex = r'\A[\w.@+-]+\Z'
+ message = _(
+ 'Enter a valid username. This value may contain only letters, '
+ 'numbers, and @/./+/-/_ characters.'
+ )
+ flags = 0
\ No newline at end of file