Browse Source

Added default value for the position
Re-wrapped some lines

sh4nks 11 years ago
parent
commit
9b976c115e
1 changed files with 10 additions and 4 deletions
  1. 10 4
      flaskbb/admin/forms.py

+ 10 - 4
flaskbb/admin/forms.py

@@ -223,16 +223,22 @@ class ForumForm(Form):
     description = TextAreaField("Description", validators=[
         Optional()])
 
-    position = IntegerField("Position", validators=[
+    position = IntegerField("Position", default=1, validators=[
         Required(message="Forum position required")])
 
     parent = QuerySelectField("Parent",
                               query_factory=selectable_forums,
                               get_label="title",
-                              description="This field is not saved if this forum is a category (see \"Is a category?\" field below).")
+                              description="This field is not saved if this \
+                                           forum is a category (see \"Is a \
+                                           category?\" field below).")
 
-    is_category = BooleanField("Is a category?", description="Categories are root-level parents for forums.  They can not contain topics.")
-    locked = BooleanField("Locked?", description="Disable new posts and topics in this forum.")
+    is_category = BooleanField("Is a category?",
+                               description="Categories are root-level parents \
+                               for forums. They can not contain topics.")
+
+    locked = BooleanField("Locked?", description="Disable new posts and topics \
+                                                  in this forum.")
 
     def validate_parent(self, field):
         if field.data.id == self._id: