allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [3/3] allura git commit: [#7943] ticket:842 Remove /_discuss/ endpoint
Date Fri, 02 Oct 2015 14:06:24 GMT
[#7943] ticket:842 Remove /_discuss/ endpoint


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

Branch: refs/heads/master
Commit: dcec6157ef78a5706d97d33170414f84c352d5b6
Parents: 70001e2
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Oct 1 14:21:54 2015 +0000
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Oct 2 10:06:07 2015 -0400

----------------------------------------------------------------------
 Allura/allura/controllers/discuss.py                | 16 +++-------------
 .../forgediscussion/controllers/forum.py            | 11 +++++++----
 2 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/dcec6157/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index df8076d..36a9b97 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -89,18 +89,12 @@ class DiscussionController(BaseController, FeedController):
         if not hasattr(self, 'moderate'):
             self.moderate = ModerationController(self)
 
-    @with_trailing_slash
-    @expose('jinja:allura:templates/discussion/index.html')
-    def index(self, threads=None, limit=None, page=0, count=0, **kw):
-        c.discussion = self.W.discussion
-        c.discussion_header = self.W.discussion_header
-        if threads is None:
-            threads = self.discussion.threads
-        return dict(discussion=self.discussion, limit=limit, page=page, count=count, threads=threads)
+    def error_handler(self, *args, **kwargs):
+        redirect(request.referer)
 
     @h.vardec
     @expose()
-    @validate(pass_validator, error_handler=index)
+    @validate(pass_validator, error_handler=error_handler)
     def subscribe(self, **kw):
         threads = kw.pop('threads', [])
         for t in threads:
@@ -528,7 +522,3 @@ class ThreadRestController(ThreadController):
 class AppDiscussionRestController(AppDiscussionController):
     ThreadController = ThreadRestController
     PostController = PostRestController
-
-    @expose('json:')
-    def index(self, **kw):
-        return dict(discussion=self.discussion)

http://git-wip-us.apache.org/repos/asf/allura/blob/dcec6157/ForgeDiscussion/forgediscussion/controllers/forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/forum.py b/ForgeDiscussion/forgediscussion/controllers/forum.py
index 8d0117d..8229151 100644
--- a/ForgeDiscussion/forgediscussion/controllers/forum.py
+++ b/ForgeDiscussion/forgediscussion/controllers/forum.py
@@ -107,12 +107,15 @@ class ForumController(DiscussionController):
         c.subscribed = M.Mailbox.subscribed(artifact=self.discussion)
         threads = DM.ForumThread.query.find(dict(discussion_id=self.discussion._id, num_replies={'$gt':
0})) \
                                       .sort([('flags', pymongo.DESCENDING), ('last_post_date',
pymongo.DESCENDING)])
-        response = super(
-            ForumController, self).index(threads=threads.skip(start).limit(int(limit)).all(),
-                                         limit=limit, page=page, count=threads.count(), **kw)
+        c.discussion = self.W.discussion
         c.discussion_header = self.W.discussion_header
         c.whole_forum_subscription_form = self.W.subscribe_form
-        return response
+        return dict(
+            discussion=self.discussion,
+            count=threads.count(),
+            threads=threads.skip(start).limit(int(limit)).all(),
+            limit=limit,
+            page=page)
 
     @expose()
     def icon(self):


Mime
View raw message