From ffca452407e6db063843d3584751d5dc8481fa16 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Wed, 21 Mar 2012 10:32:20 -0700 Subject: [PATCH] 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. --- r2/r2/controllers/listingcontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r2/r2/controllers/listingcontroller.py b/r2/r2/controllers/listingcontroller.py index fedb4d94b..e22cc0300 100644 --- a/r2/r2/controllers/listingcontroller.py +++ b/r2/r2/controllers/listingcontroller.py @@ -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)