incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [07/50] git commit: [#4902] ticket:330 remove the additional loop from create_topic
Date Fri, 24 May 2013 18:17:43 GMT
[#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/db/6007
Commit: 57c0e3eaa9a8b3b98815cd35e4c7e5916fd08876
Parents: 4ee67b6
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Thu May 9 01:02:08 2013 +0400
Committer: Cory Johns <cjohns@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()


Mime
View raw message