incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [14/22] git commit: [#7063] Added last_edited field to discussion REST
Date Tue, 21 Jan 2014 22:09:29 GMT
[#7063] Added last_edited field to discussion REST

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/f6b77b8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f6b77b8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f6b77b8b

Branch: refs/heads/tv/6393
Commit: f6b77b8b74475b1665b54c0f3820cd26895e436e
Parents: 4b4c147
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu Jan 16 16:29:09 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Jan 16 20:23:29 2014 +0000

----------------------------------------------------------------------
 Allura/allura/model/discuss.py                                | 2 ++
 ForgeDiscussion/forgediscussion/tests/functional/test_rest.py | 1 +
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f6b77b8b/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 4303c66..1fddf91 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -173,6 +173,7 @@ class Thread(Artifact, ActivityObject):
                         subject=p.subject,
                         author=p.author().username,
                         timestamp=p.timestamp,
+                        last_edited=p.last_edit_date,
                         attachments=[dict(bytes=attach.length,
                                           url=h.absurl(attach.url())) for attach in p.attachments])
                    for p in self.query_posts(status='ok', style='chronological', limit=limit,
page=page)
@@ -480,6 +481,7 @@ class Post(Message, VersionedArtifact, ActivityObject):
             text=self.text,
             flagged_by=map(str, self.flagged_by),
             timestamp=self.timestamp,
+            last_edited=self.last_edit_date,
             author_id=str(author._id),
             author=author.username)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f6b77b8b/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py b/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
index dd02429..1b7d080 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
@@ -142,6 +142,7 @@ class TestRootRestController(TestDiscussionApiBase):
         assert_equal(topic['posts'][0]['text'], 'Hi boys and girls')
         assert_equal(topic['posts'][0]['subject'], 'Hi guys')
         assert_in('timestamp', topic['posts'][0])
+        assert_in('last_edited', topic['posts'][0])
 
     def test_forum_list_pagination(self):
         resp = self.app.get('/rest/p/test/discussion/?limit=1')


Mime
View raw message