You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/05/22 16:56:43 UTC

[2/4] git commit: [#4902] ticket:330 remove the additional loop from create_topic

[#4902]  ticket:330  remove the additional loop from create_topic


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/57c0e3ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/57c0e3ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/57c0e3ea

Branch: refs/heads/master
Commit: 57c0e3eaa9a8b3b98815cd35e4c7e5916fd08876
Parents: 4ee67b6
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Thu May 9 01:02:08 2013 +0400
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed May 22 14:56:16 2013 +0000

----------------------------------------------------------------------
 .../forgediscussion/controllers/root.py            |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/57c0e3ea/ForgeDiscussion/forgediscussion/controllers/root.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index f64dcf4..45a81d6 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -100,15 +100,15 @@ class RootController(BaseController, DispatchIndex, FeedController):
                                              parent_id=None,
                                              deleted=False))
         current_forum = None
+        c.new_topic = self.W.new_topic
+        my_forums = []
         for f in forums:
                 if request.referer and (f.url() in request.referer):
                     current_forum = f.shortname
+                if has_access(f, 'post')():
+                    my_forums.append(f)
 
-        c.new_topic = self.W.new_topic
-        forums = [f for f in model.Forum.query.find(dict(
-                             app_config_id=c.app.config._id,
-                             parent_id=None)).all() if has_access(f, 'post')() and not f.deleted]
-        return dict(forums=forums, current_forum=current_forum)
+        return dict(forums=my_forums, current_forum=current_forum)
 
     @h.vardec
     @expose()