admin: Set default order_by to 'created' (desc) (#649)

This shows recent comments first in the admin panel.
This commit is contained in:
ix5 2020-05-09 15:22:44 +02:00 committed by GitHub
parent 2ba7217900
commit d7eefbc072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1134,8 +1134,8 @@ class API(object):
return render_template('login.html', isso_host_script=isso_host_script)
page_size = 100
page = int(req.args.get('page', 0))
order_by = req.args.get('order_by', None)
asc = int(req.args.get('asc', 1))
order_by = req.args.get('order_by', 'created')
asc = int(req.args.get('asc', 0))
mode = int(req.args.get('mode', 2))
comments = self.comments.fetchall(mode=mode, page=page,
limit=page_size,