incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [2/2] git commit: [#5009] ensure trove changes are flushed to db before sending an update event
Date Wed, 31 Oct 2012 14:49:31 GMT
[#5009] ensure trove changes are flushed to db before sending an update event


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

Branch: refs/heads/master
Commit: beeb0e7363ba34428ec30765a2f02f8ea3ac0fef
Parents: 762583e
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Tue Oct 30 21:17:19 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Wed Oct 31 14:48:09 2012 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/beeb0e73/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 0810e8e..7116990 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -9,6 +9,7 @@ from tg import expose, redirect, flash, validate, config
 from tg.decorators import with_trailing_slash, without_trailing_slash
 from webob import exc
 from bson import ObjectId
+from ming.orm.ormsession import ThreadLocalORMSession
 
 from allura.app import Application, DefaultAdminController, SitemapEntry
 from allura.lib import helpers as h
@@ -362,6 +363,7 @@ class ProjectAdminController(BaseController):
             if trove_obj._id not in current_troves:
                 current_troves.append(trove_obj._id)
                 M.AuditLog.log('add trove %s: %s', type, trove_obj.fullpath)
+                ThreadLocalORMSession.flush_all()  # just in case the event handling is super
fast
                 g.post_event('project_updated')
             else:
                 error_msg = 'This category has already been assigned to the project.'
@@ -392,6 +394,7 @@ class ProjectAdminController(BaseController):
         if trove_obj is not None and trove_obj._id in current_troves:
             M.AuditLog.log('remove trove %s: %s', type, trove_obj.fullpath)
             current_troves.remove(trove_obj._id)
+            ThreadLocalORMSession.flush_all()  # just in case the event handling is super
fast
             g.post_event('project_updated')
         redirect('trove')
 


Mime
View raw message