allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [11/16] allura git commit: [#8230] Update thread edit info when markdown changes
Date Mon, 15 Oct 2018 16:02:35 GMT
[#8230] Update thread edit info when markdown changes


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

Branch: refs/heads/master
Commit: 0d652633e8e7620da55ca6ab72dcb2cbaef903a6
Parents: 4e4dae0
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Wed Oct 10 21:43:19 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Oct 15 15:50:29 2018 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/discuss.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/0d652633/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index b188a75..6bdc289 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -349,6 +349,9 @@ class PostController(BaseController):
     def update_markdown(self, text=None, **kw):  
         if has_access(self.post, 'moderate'):
             self.post.text = text
+            self.post.edit_count = self.post.edit_count + 1
+            self.post.last_edit_date = datetime.utcnow()
+            self.post.last_edit_by_id = c.user._id
             self.post.commit()
             g.director.create_activity(c.user, 'modified', self.post,
                             target=self.post.thread.artifact or self.post.thread,


Mime
View raw message