You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2014/01/10 16:58:13 UTC

[16/16] git commit: [#7005] Fixed test failures due to detatched c.project

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

Signed-off-by: Cory Johns <cj...@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/1191631c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1191631c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1191631c

Branch: refs/heads/cj/7005
Commit: 1191631c083b096dba41c6b5f0746428c9e51276
Parents: 18b3066
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Jan 10 15:57:40 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Fri Jan 10 15:57:40 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/1191631c/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 1fdbb49..886f4ee 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -619,9 +619,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)