--- a/ForgeDiscussion/forgediscussion/widgets/admin.py
+++ b/ForgeDiscussion/forgediscussion/widgets/admin.py
@@ -42,10 +42,10 @@
def fields(self):
fields = [
ew.HiddenField(name='app_id', label='App'),
- ew.TextField(name='name', label='Name'),
+ ew.TextField(name='name', label='Name', validator=fev.UnicodeString()),
ew.TextField(name='shortname', label='Short Name',
validator=All(
- fev.Regex(r"^[^\s\/\.]*$", not_empty=True, messages={
+ fev.Regex(ur"^[^\s\/\.]*$", not_empty=True, messages={
'invalid':'Shortname cannot contain space . or /',
'empty':'You must create a short name for the forum.'}),
UniqueForumShortnameValidator())),
@@ -62,7 +62,7 @@
def _to_python(self, value, state):
forums = DM.Forum.query.find(dict(app_config_id=ObjectId(state.full_dict['app_id']))).all()
- value = h.really_unicode(value.lower() or '').encode('utf-8')
+ value = h.really_unicode(value.lower() or '')
if value in [ f.shortname for f in forums ]:
raise formencode.Invalid('A forum already exists with that short name, please choose another.', value, state)
return value