mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Refactor ListingController so api_doc can get param info.
By moving @base_listing to the same function as @api_doc, the validators @base_listing adds become accessible to the parameter documentation. As far as I can tell, this is the only place build_listing is called, so I believe this transformation is safe.
This commit is contained in:
@@ -89,8 +89,7 @@ class ListingController(RedditController):
|
||||
etc) to be displayed on this listing page"""
|
||||
return []
|
||||
|
||||
@base_listing
|
||||
def build_listing(self, num, after, reverse, count):
|
||||
def build_listing(self, num, after, reverse, count, **kwargs):
|
||||
"""uses the query() method to define the contents of the
|
||||
listing and renders the page self.render_cls(..).render() with
|
||||
the listing as contents"""
|
||||
@@ -180,6 +179,7 @@ class ListingController(RedditController):
|
||||
|
||||
builder_wrapper = staticmethod(default_thing_wrapper())
|
||||
|
||||
@base_listing
|
||||
def GET_listing(self, **env):
|
||||
check_cheating('site')
|
||||
return self.build_listing(**env)
|
||||
|
||||
Reference in New Issue
Block a user