This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
neuf-userinfo/neuf_userinfo/validators.py
T

9 lines
357 B
Python

from django.core.validators import RegexValidator
import re
# Passwords should not contain "
password_re = re.compile(r'(?<!\")', re.IGNORECASE)
PasswordValidator = RegexValidator(password_re, u'Enter a valid password')
username_re = re.compile(r'^[a-z][a-z0-9]*$') # TODO Length
UsernameValidator = RegexValidator(username_re, u'Enter a valid username')