From 4e1b747bb2b0e8d563c288e87a6e6f310e2e10ef Mon Sep 17 00:00:00 2001 From: farhaanbukhsh Date: Nov 14 2015 13:58:26 +0000 Subject: Fixing issue of prevent project name starting with - and PEP8 standards --- diff --git a/pagure/forms.py b/pagure/forms.py index 8c6f415..b20500e 100644 --- a/pagure/forms.py +++ b/pagure/forms.py @@ -16,6 +16,7 @@ import wtforms STRICT_REGEX = '^[a-zA-Z0-9-_]+$' TAGS_REGEX = '^[a-zA-Z0-9-_, .]+$' +PROJECT_NAME_REGEX = '^[a-zA-z0-9_][a-zA-Z0-9-_]+$' class ProjectFormSimplified(wtf.Form): @@ -44,7 +45,7 @@ class ProjectForm(ProjectFormSimplified): 'Project name *', [ wtforms.validators.Required(), - wtforms.validators.Regexp(STRICT_REGEX, flags=re.IGNORECASE) + wtforms.validators.Regexp(PROJECT_NAME_REGEX, flags=re.IGNORECASE) ] ) @@ -344,6 +345,7 @@ class EditFileForm(wtf.Form): (email.email, email.email) for email in kwargs['emails'] ] + class DefaultBranchForm(wtf.Form): """Form to change the default branh for a repository""" branches = wtforms.SelectField(