allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [1/2] git commit: [#7005] Fixed test failures due to detatched c.project
Date Fri, 10 Jan 2014 16:26:06 GMT
Updated Branches:
  refs/heads/master abd53ba5d -> 3b3bf8e18


[#7005] Fixed test failures due to detatched c.project

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/master
Commit: 3b3bf8e1824e1b3e26b917e50898ba65f23c4079
Parents: 1af790d
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Fri Jan 10 15:57:40 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Fri Jan 10 16:25:41 2014 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3b3bf8e1/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 3e84ab6..950d3bc 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -626,9 +626,11 @@ class Repository(Artifact, ActivityObject):
         `c.project`.
         '''
         from allura.model import Project
-        session(c.project).flush(c.project)
-        session(c.project).expunge(c.project)
-        c.project = Project.query.get(_id=c.project._id)
+        project_session = session(c.project)
+        if project_session:
+            session(c.project).flush(c.project)
+            session(c.project).expunge(c.project)
+            c.project = Project.query.get(_id=c.project._id)
         self.status = status
         session(self).flush(self)
 


Mime
View raw message