From 6d6b68f2706b3cb23f4b28cd66dc91411ee5363d Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Fri, 20 Jan 2017 23:36:21 +0100 Subject: [PATCH] Better Regex for uservalidation / callvalidation --- contest/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contest/validators.py b/contest/validators.py index 709c2aa..22b5f95 100644 --- a/contest/validators.py +++ b/contest/validators.py @@ -9,7 +9,7 @@ import re @deconstructible class CallUsernameValidator(validators.RegexValidator): #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 = _( 'Enter a valid Callsign as Username, ALL UPPERCASE, if needed with /A /B,' 'e.g. DL7BST, DN1BER/A, DL/OE1FOO'