allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#7309] ensure c.project is set for all nbhd methods
Date Tue, 15 Apr 2014 19:53:59 GMT
Repository: allura
Updated Branches:
  refs/heads/db/7309 c74f952ba -> 60703ea1a


[#7309] ensure c.project is set for all nbhd methods


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

Branch: refs/heads/db/7309
Commit: 60703ea1a49a502bfcb533029935dd9437a52993
Parents: c74f952
Author: Dave Brondsema <dave@brondsema.net>
Authored: Tue Apr 15 15:53:49 2014 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Tue Apr 15 15:53:49 2014 -0400

----------------------------------------------------------------------
 Allura/allura/controllers/project.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/60703ea1/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index c22eb14..8452a6e 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -81,6 +81,10 @@ class NeighborhoodController(object):
 
     def _check_security(self):
         require_access(self.neighborhood, 'read')
+        # A bit of a hack, but _check_security is best place to set c.project
+        # for this whole controller.  __init__ would be nice, but it gets
+        # clobbered by root.py _setup_request.  This gets run after that.
+        c.project = self.neighborhood.neighborhood_project
 
     @expose()
     def _lookup(self, pname, *remainder):
@@ -131,7 +135,6 @@ class NeighborhoodController(object):
     @expose('jinja:allura:templates/neighborhood_project_list.html')
     @with_trailing_slash
     def index(self, sort='alpha', limit=25, page=0, **kw):
-        c.project = self.neighborhood.neighborhood_project
         if self.neighborhood.redirect:
             redirect(self.neighborhood.redirect)
         if not self.neighborhood.has_home_tool:
@@ -181,7 +184,6 @@ class NeighborhoodController(object):
     @expose('jinja:allura:templates/neighborhood_add_project.html')
     @without_trailing_slash
     def add_project(self, **form_data):
-        c.project = self.neighborhood.neighborhood_project
         require_access(self.neighborhood, 'register')
         c.add_project = W.add_project
         form_data.setdefault(


Mime
View raw message