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/06/17 17:17:36 UTC
[28/35] allura git commit: [#7890] ticket:801 Ensure Ming's session
contains neighborhood, before changing it
[#7890] ticket:801 Ensure Ming's session contains neighborhood, before changing it
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/976b98b8
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/976b98b8
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/976b98b8
Branch: refs/heads/ib/7884
Commit: 976b98b867de6e964cba414d7fa5c4550b7cf038
Parents: a52e33f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Jun 15 17:27:23 2015 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Jun 16 18:23:47 2015 +0000
----------------------------------------------------------------------
Allura/allura/controllers/project.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/976b98b8/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 2f6d9be..195115f 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -642,7 +642,12 @@ class NeighborhoodAdminController(object):
@require_post()
@validate(W.neighborhood_overview_form, error_handler=overview)
def update(self, name=None, css=None, homepage=None, project_template=None, icon=None, **kw):
- nbhd = self.neighborhood
+ # We need to get neighborhood from Mongo to populate Ming's session. If
+ # neighborhood object is coming from cache (i.e.
+ # neighborhood.cache.duration is set), then it will be absent in Ming's
+ # session for current thread, thus all changes will not be flushed to
+ # disk. See #7890 for details.
+ nbhd = M.Neighborhood.query.get(_id=self.neighborhood._id)
c.project = nbhd.neighborhood_project
h.log_if_changed(nbhd, 'name', name,
'change neighborhood name to %s' % name)