You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/11/30 13:35:10 UTC
allura git commit: Re-use c.app in sitemap if possible. Can save some
app.__init__ time, enable better within-app caching, etc
Repository: allura
Updated Branches:
refs/heads/master b2b53d0c1 -> 849433079
Re-use c.app in sitemap if possible. Can save some app.__init__ time, enable better within-app caching, etc
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/84943307
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/84943307
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/84943307
Branch: refs/heads/master
Commit: 849433079c05aa4bcb18f0b913708061e07ba14c
Parents: b2b53d0
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Nov 25 12:10:29 2015 -0500
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Nov 30 12:34:24 2015 +0000
----------------------------------------------------------------------
Allura/allura/model/project.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/84943307/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 7d917f1..1dfd3a3 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -549,7 +549,11 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
log.exception('AppConfig %s references invalid tool %s',
ac._id, ac.tool_name)
continue
- app = App(self, ac)
+ if c.app and c.app.config._id == ac._id:
+ # slight performance gain (depending on the app) by using the current app if we're on it
+ app = c.app
+ else:
+ app = App(self, ac)
if app.is_visible_to(c.user):
for sm in app.main_menu():
entry = sm.bind_app(app)