incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [03/14] git commit: [#6545] [#5907] use status in last_post()
Date Tue, 10 Sep 2013 16:17:23 GMT
[#6545] [#5907] use status in last_post()

* we only want to show approved posts
* it uses the (discussion_id, status, timestamp) index


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

Branch: refs/heads/master
Commit: 192793e8b2d81b66b8050f40bb134444c5f6a848
Parents: 5808394
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Sep 4 15:24:44 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Sep 10 14:31:48 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/discuss.py                                 | 5 +++--
 ForgeDiscussion/forgediscussion/tests/functional/test_forum.py | 5 ++---
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/192793e8/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 07a6269..e227b47 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -92,9 +92,10 @@ class Discussion(Artifact, ActivityObject):
 
     @LazyProperty
     def last_post(self):
-        # TODO add status: to query
         q = self.post_class().query.find(dict(
-                discussion_id=self._id))\
+                discussion_id=self._id,
+                status='ok'
+                ))\
             .sort('timestamp', pymongo.DESCENDING)\
             .limit(1)\
             .hint([('discussion_id', pymongo.ASCENDING),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/192793e8/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
index 89efa7c..12238c8 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
@@ -353,9 +353,8 @@ class TestForum(TestController):
             assert r.location.startswith('http://localhost/p/test/discussion/testforum/thread/'),
r.location
 
         def _check():
-            # FIXME fix [#5907]
-            #r = self.app.get('/discussion/')
-            #assert 'Test Zero Posts' not in r
+            r = self.app.get('/discussion/')
+            assert 'Test Zero Posts' not in r
             r = self.app.get('/discussion/testforum/')
             assert 'Test Zero Posts' not in r
 


Mime
View raw message