Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/r2/r2/controllers/listingcontroller.py b/r2/r2/controllers/listingcontroller.py
- index 4874852..2d4392a 100644
- --- a/r2/r2/controllers/listingcontroller.py
- +++ b/r2/r2/controllers/listingcontroller.py
- @@ -790,7 +790,10 @@ class CommentsController(ListingController):
- title_text = _('comments')
- def query(self):
- - return c.site.get_all_comments()
- + if c.site == Default:
- + return c.site.get_all_comments()
- + else:
- + return queries.get_sr_comments(c.site)
- def GET_listing(self, **env):
- c.profilepage = True
- diff --git a/r2/r2/lib/db/queries.py b/r2/r2/lib/db/queries.py
- index 18ab876..d3b020a 100644
- --- a/r2/r2/lib/db/queries.py
- +++ b/r2/r2/lib/db/queries.py
- @@ -460,6 +460,12 @@ def get_all_comments():
- q = Comment._query(sort = desc('_date'))
- return make_results(q)
- +def get_sr_comments(sr):
- + """r/subreddit/comments page"""
- + comments = Comment._query(Comment.c.sr_id == sr._id,
- + sort = desc('_date'))
- + return comments
- +
- def get_comments(user, sort, time):
- return user_query(Comment, user, sort, time)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement