summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2013-09-04 16:16:30 +0000
committerpad <pad@vm-pad-b.spline.inf.fu-berlin.de>2013-09-04 16:16:30 +0000
commit9442c09eebcd0f67f6f15a1a919504c7678b7ce8 (patch)
treedae9f27328c84022c31697058171a387574e81ba
parentad1c6e8417a0200268aa415b13a5adab58f9f5ad (diff)
downloadpadlite-teams-9442c09eebcd0f67f6f15a1a919504c7678b7ce8.tar.gz
padlite-teams-9442c09eebcd0f67f6f15a1a919504c7678b7ce8.tar.bz2
padlite-teams-9442c09eebcd0f67f6f15a1a919504c7678b7ce8.zip
forms: group name should not start with special character
The route /<group_name>/ is used for displaying the group infos. If you want to support additional sites (like all public browsable groups), you need a possibility to recognize such urls. So the group name now has to start with a non special characters. So we could support paths like /_all/ for special pages.
-rw-r--r--forms.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/forms.py b/forms.py
index d1fad64..ec643ac 100644
--- a/forms.py
+++ b/forms.py
@@ -7,6 +7,8 @@ class CreateGroup(Form):
validators.Required(),
validators.Regexp('^[a-zA-Z1-9_-]+$',
message=u'Invalid group name (only simple characters, numbers, - and _).'),
+ validators.Regexp('^[a-zA-Z1-9]',
+ message=u'Group name should not start with a special character.'),
Unique(Group, Group.name,
message=u'A group with this name already exists.')])