allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#7890] ticket:801 Ensure Ming's session contains neighborhood, before changing it
Date Tue, 16 Jun 2015 18:32:00 GMT
Repository: allura
Updated Branches:
  refs/heads/master a52e33f9c -> 976b98b86


[#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/master
Commit: 976b98b867de6e964cba414d7fa5c4550b7cf038
Parents: a52e33f
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Jun 15 17:27:23 2015 +0300
Committer: Dave Brondsema <dbrondsema@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)


Mime
View raw message