mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
ikiwiki: Allow only alphanumerics in wiki/blog name
This commit is contained in:
parent
51386bfe37
commit
68046b638b
@ -21,6 +21,7 @@ Forms for configuring ikiwiki
|
|||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from django.core.validators import RegexValidator
|
||||||
|
|
||||||
|
|
||||||
class IkiwikiCreateForm(forms.Form):
|
class IkiwikiCreateForm(forms.Form):
|
||||||
@ -29,7 +30,8 @@ class IkiwikiCreateForm(forms.Form):
|
|||||||
label=_('Type'),
|
label=_('Type'),
|
||||||
choices=[('wiki', 'Wiki'), ('blog', 'Blog')])
|
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'))
|
admin_name = forms.CharField(label=_('Admin Account Name'))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user