Browse Source

Fix moderator actions when no topics are selected

Peter Justin 9 years ago
parent
commit
8d6664e9aa
1 changed files with 5 additions and 0 deletions
  1. 5 0
      flaskbb/forum/views.py

+ 5 - 0
flaskbb/forum/views.py

@@ -315,6 +315,11 @@ def manage_forum(forum_id, slug=None):
         ids = request.form.getlist("rowid")
         tmp_topics = Topic.query.filter(Topic.id.in_(ids)).all()
 
+        if not len(tmp_topics) > 0:
+            flash(_("In order to perform this action you have to select at "
+                    " least one topic."), "danger")
+            return redirect(mod_forum_url)
+
         # locking/unlocking
         if "lock" in request.form:
             changed = do_topic_action(topics=tmp_topics, user=current_user,