mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #6861 (0.7.19 stanza catalog not working. Giving 400 Bad Request)
This commit is contained in:
parent
b85bc6517a
commit
5f2c784cb0
@ -56,7 +56,7 @@ class ContentServer(object):
|
||||
|
||||
def sort(self, items, field, order):
|
||||
field = self.db.data.sanitize_sort_field_name(field)
|
||||
if field not in ('title', 'authors', 'rating', 'timestamp', 'tags', 'size', 'series'):
|
||||
if field not in self.db.field_metadata.field_keys():
|
||||
raise cherrypy.HTTPError(400, '%s is not a valid sort field'%field)
|
||||
keyg = CSSortKeyGenerator([(field, order)], self.db.field_metadata)
|
||||
items.sort(key=keyg, reverse=not order)
|
||||
|
Loading…
x
Reference in New Issue
Block a user