You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2018/12/06 17:15:40 UTC
allura git commit: [#8222] fix TestForumMessageHandling failure that
accessed versioned history of posts
Repository: allura
Updated Branches:
refs/heads/db/8222 [created] 411553677
[#8222] fix TestForumMessageHandling failure that accessed versioned history of posts
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/41155367
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/41155367
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/41155367
Branch: refs/heads/db/8222
Commit: 411553677a65dbe69b5c032c028f1ef193e78d44
Parents: be7cd68
Author: Dave Brondsema <da...@brondsema.net>
Authored: Thu Dec 6 12:14:39 2018 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Thu Dec 6 12:14:39 2018 -0500
----------------------------------------------------------------------
Allura/allura/controllers/discuss.py | 1 +
Allura/allura/lib/app_globals.py | 12 +++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/41155367/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index c7f21ed..662c085 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -337,6 +337,7 @@ class PostController(BaseController):
attachments=self.post.attachments,
related_artifacts=self.post.related_artifacts,
parent_security_context=lambda: None,
+ last_edit_by=lambda: self.post.last_edit_by()
)
else:
post = self.post
http://git-wip-us.apache.org/repos/asf/allura/blob/41155367/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 02980c1..974b682 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -136,9 +136,15 @@ class ForgeMarkdown(markdown.Markdown):
cache.md5, cache.html, cache.render_time = md5, html, render_time
cache.fix7528 = bugfix_rev # flag to indicate good caches created after [#7528] and other critical bugs were fixed.
- with utils.skip_mod_date(artifact.__class__), \
- utils.skip_last_updated(artifact.__class__):
- session(artifact).flush(artifact)
+ try:
+ sess = session(artifact)
+ except AttributeError:
+ # this can happen if a non-artifact object is used
+ log.exception('Could not get session for %s', artifact)
+ else:
+ with utils.skip_mod_date(artifact.__class__), \
+ utils.skip_last_updated(artifact.__class__):
+ sess.flush(artifact)
return html