incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [13/50] git commit: [#6388] avoid 1 mongo query in test controller setup
Date Mon, 06 Jan 2014 15:18:03 GMT
[#6388] avoid 1 mongo query in test controller setup


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

Branch: refs/heads/cj/6992
Commit: 78c036468c2f803075af82872f5410fca49ee7f5
Parents: a7ab2f3
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Thu Dec 19 18:30:41 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Jan 2 16:16:20 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/basetest_project_root.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/78c03646/Allura/allura/controllers/basetest_project_root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/basetest_project_root.py b/Allura/allura/controllers/basetest_project_root.py
index b73a851..ceb597b 100644
--- a/Allura/allura/controllers/basetest_project_root.py
+++ b/Allura/allura/controllers/basetest_project_root.py
@@ -67,9 +67,12 @@ class BasetestProjectRootController(WsgiDispatchController, ProjectController):
 
     def __init__(self):
         for n in M.Neighborhood.query.find():
-            if n.url_prefix.startswith('//'): continue
+            if n.url_prefix.startswith('//'):
+                continue
             n.bind_controller(self)
-        self.p_nbhd = M.Neighborhood.query.get(name='Projects')
+            if n.url_prefix == '/p/':
+                self.p_nbhd = n
+
         proxy_root = RootController()
         self.dispatch = DispatchTest()
         self.security = SecurityTests()


Mime
View raw message