fix 500 error on pagination

This commit is contained in:
Benoît Latinier 2016-10-27 23:18:37 +02:00
parent 0b6a0e4d5f
commit 3212bf762f

View File

@ -519,9 +519,9 @@ class API(object):
if not data or not data['logged']:
return render_template('login.html')
page_size = 100
page = req.args.get('page', 0)
page = int(req.args.get('page', 0))
order_by = req.args.get('order_by', "id")
mode = req.args.get('mode', 2)
mode = int(req.args.get('mode', 2))
comments = self.comments.fetchall(mode=mode, page=page,
limit=page_size,
order_by=order_by)