From 456793fa234dfbc6e86252c4a5a2d6fe7b1adc0e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 12 2015 14:02:59 +0000 Subject: Make a more flexible regex as some entries can contain spaces or some characters --- diff --git a/pagure/forms.py b/pagure/forms.py index 552fe9c..637445e 100644 --- a/pagure/forms.py +++ b/pagure/forms.py @@ -14,7 +14,8 @@ import wtforms # pylint: disable=R0903,W0232,E1002 -REGEX = '^[a-zA-Z0-9]+$' +REGEX = '^[a-zA-Z0-9-_]+$' +REGEX2 = '^[a-zA-Z0-9 ]+$' class ProjectFormSimplified(wtf.Form): @@ -50,7 +51,7 @@ class IssueFormSimplied(wtf.Form): 'Title*', [ wtforms.validators.Required(), - wtforms.validators.Regexp(REGEX, flags=re.IGNORECASE) + wtforms.validators.Regexp(REGEX2, flags=re.IGNORECASE) ] ) issue_content = wtforms.TextAreaField( @@ -89,7 +90,7 @@ class RequestPullForm(wtf.Form): 'Title*', [ wtforms.validators.Required(), - wtforms.validators.Regexp(REGEX, flags=re.IGNORECASE) + wtforms.validators.Regexp(REGEX2, flags=re.IGNORECASE) ] )