From f9ba4d1bf15301523350d8fca3ab1925c6b2b173 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Wed, 6 May 2015 19:00:44 +0200 Subject: [PATCH] findChangeLog: don't crash if sort is unspecified This would crash: api.findChangeLogs(keys=[]) because there's no 'name' key for changelog entries. Instead, default to chronological order, newest first. --- pandora/changelog/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/changelog/views.py b/pandora/changelog/views.py index e853272a..3d92aabd 100644 --- a/pandora/changelog/views.py +++ b/pandora/changelog/views.py @@ -18,7 +18,7 @@ import models def parse_query(data, user): query = {} query['range'] = [0, 100] - query['sort'] = [{'key':'name', 'operator':'+'}] + query['sort'] = [{'key':'created', 'operator':'-'}] for key in ('keys', 'group', 'list', 'range', 'sort', 'query'): if key in data: query[key] = data[key]