From a5e831ec213549660e5b6c811f480a23c42acb6d Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Thu, 30 May 2019 22:00:21 +0200 Subject: [PATCH] Fix regexes --- whoisdb/validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whoisdb/validators.py b/whoisdb/validators.py index e30dedd..3cc9b52 100644 --- a/whoisdb/validators.py +++ b/whoisdb/validators.py @@ -14,7 +14,7 @@ import ipaddress @deconstructible class HandleValidator(validators.RegexValidator): - regex = r'^(?:[A-Z]+[0-9]*(-[A-Z]+)|AUTO)' + regex = r'^(?:[A-Z]+[0-9]*(-[A-Z]+)|AUTO)$' message = _( 'Enter a valid handle (all uppercase)' ) @@ -26,7 +26,7 @@ class HandleValidatorWithSuffix(validators.RegexValidator): flags = re.ASCII if six.PY3 else 0 def __init__(self, suffix): - self.regex = r'^(?:[A-Z]+[0-9]*-%s|AUTO)' % re.escape(suffix) + self.regex = r'^(?:[A-Z]+[0-9]*-%s|AUTO)$' % re.escape(suffix) self.message = _( 'Enter a valid handle with suffix %s (all uppercase), e.g. FOO3-%s' % (suffix, suffix) )