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.
This commit is contained in:
Chad Birch
2013-10-31 18:38:11 -06:00
parent 4c775ff2d1
commit 30663ba798

View File

@@ -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: