Better Regex for uservalidation / callvalidation

This commit is contained in:
Sebastian Lohff 2017-01-20 23:36:21 +01:00
parent 9104b07c85
commit 6d6b68f270
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import re
@deconstructible @deconstructible
class CallUsernameValidator(validators.RegexValidator): class CallUsernameValidator(validators.RegexValidator):
#regex = r'^[\w.@+-]+$' #regex = r'^[\w.@+-]+$'
regex = r'^(?:[A-Z]+/)?[A-Z]{1,2}[0-9][A-Z]{1,4}(?:/[A-Z])?$' regex = r'^(?:[A-Z]+/)?[A-Z]{1,2}[0-9][A-Z]{1,4}(?:-[0-9])?(?:/p)?$'
message = _( message = _(
'Enter a valid Callsign as Username, ALL UPPERCASE, if needed with /A /B,' 'Enter a valid Callsign as Username, ALL UPPERCASE, if needed with /A /B,'
'e.g. DL7BST, DN1BER/A, DL/OE1FOO' 'e.g. DL7BST, DN1BER/A, DL/OE1FOO'