ikiwiki: Allow only alphanumerics in wiki/blog name

This commit is contained in:
Hemanth Kumar Veeranki 2016-09-19 19:00:08 +05:30 committed by James Valleroy
parent 51386bfe37
commit 68046b638b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -21,6 +21,7 @@ Forms for configuring ikiwiki
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.core.validators import RegexValidator
class IkiwikiCreateForm(forms.Form):
@ -29,7 +30,8 @@ class IkiwikiCreateForm(forms.Form):
label=_('Type'),
choices=[('wiki', 'Wiki'), ('blog', 'Blog')])
name = forms.CharField(label=_('Name'))
name = forms.CharField(label=_('Name'),
validators=[RegexValidator(regex='^[a-zA-Z0-9]+$')])
admin_name = forms.CharField(label=_('Admin Account Name'))