Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /ForgeDiscussion/forgediscussion/widgets/admin.py [43e3e8] .. [f34308] Maximize Restore

  Switch to side-by-side view

--- a/ForgeDiscussion/forgediscussion/widgets/admin.py
+++ b/ForgeDiscussion/forgediscussion/widgets/admin.py
@@ -42,9 +42,7 @@
     def fields(self):
         fields = [
             ew.HiddenField(name='app_id', label='App'),
-            ew.TextField(name='name', label='Name',
-                         validator=fev.UnicodeString(not_empty=True, messages={
-                             'empty':'You must create a name for the forum.'})),
+            ew.TextField(name='name', label='Name'),
             ew.TextField(name='shortname', label='Short Name',
                          validator=All(
                                  fev.Regex(r"^[^\s\/\.]*$", not_empty=True, messages={
@@ -52,7 +50,7 @@
                                     'empty':'You must create a short name for the forum.'}),
                                  UniqueForumShortnameValidator())),
             ew.TextField(name='parent', label='Parent Forum'),
-            ew.TextField(name='description', label='Description'),
+            ew.TextField(name='description', label='Description',validator=fev.UnicodeString()),
             ffw.FileChooser(name='icon', label='Icon')
         ]
         return fields
@@ -64,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 or '').encode('utf-8').lower()
+        value = h.really_unicode(value.lower() or '').encode('utf-8')
         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