py3: Fix sorting on comments and identifiers fields

This commit is contained in:
Kovid Goyal 2019-04-14 14:52:57 +05:30
parent c6d993cfdd
commit cb117bf118
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -69,6 +69,8 @@ def __init__(self, name, table, bools_are_tristate, get_template_functions):
elif self.metadata['is_custom']:
fmt = self.metadata.get('display', {}).get('date_format', None)
self._sort_key = partial(clean_date_for_sort, fmt=fmt)
elif dt == 'comments' or name == 'identifiers':
self._default_sort_key = ''
if self.name == 'languages':
self._sort_key = lambda x:sort_key(calibre_langcode_to_name(x))