From 30663ba798aa73cbbde4fc28728c12e21aa8201d Mon Sep 17 00:00:00 2001 From: Chad Birch Date: Thu, 31 Oct 2013 18:38:11 -0600 Subject: [PATCH] Listings: use default limit if no pref_numsites Currently if the user's pref_numsites value is None (very old accounts that have not changed their preferences), listing pages return all items, and any hot listings with a sticky crash. This uses the default page size if the user has not set their own default. --- r2/r2/lib/validator/validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/lib/validator/validator.py b/r2/r2/lib/validator/validator.py index cdad046b6..e2d8bb0bf 100644 --- a/r2/r2/lib/validator/validator.py +++ b/r2/r2/lib/validator/validator.py @@ -487,7 +487,7 @@ class VLimit(Validator): def run(self, limit): default = c.user.pref_numsites - if c.render_style in ("compact", api_type("compact")): + if not default or c.render_style in ("compact", api_type("compact")): default = self.default_limit # TODO: ini param? if limit is None: