Просмотр исходного кода

Merge branch 'master' of github.com:sh4nks/flaskbb

sh4nks 11 лет назад
Родитель
Сommit
077bb4605a
2 измененных файлов с 6 добавлено и 4 удалено
  1. 0 3
      README.md
  2. 6 1
      flaskbb/admin/views.py

+ 0 - 3
README.md

@@ -4,9 +4,6 @@
 using the micro framework Flask.
 
 
-I don't have a server at the moment, so the demo does not work at http://flaskbb.org
-but you can view a few picture [here](http://imgur.com/a/RdLGz).
-
 ## FEATURES
 
 * A Bulletin Board like FluxBB, DjangoBB in Flask

+ 6 - 1
flaskbb/admin/views.py

@@ -194,10 +194,15 @@ def edit_forum(forum_id):
         forum.title = form.title.data
         forum.description = form.description.data
         forum.position = form.position.data
-        forum.parent_id = form.parent.data.id
         forum.is_category = form.is_category.data
         forum.locked = form.locked.data
         forum.moderators = form.moderators.data
+
+        if hasattr(form.parent.data, 'id'):
+            forum.parent_id = form.parent.data.id
+        else:
+            forum.parent_id = form.parent.data
+
         forum.save()
 
         flash("Forum successfully edited.", "success")