py3: use correct sort key for forcing an element to sort first

0 isn't a valid comparison for ICU sort_key() output and returns
tracebacks instead, but sort_key(0) is.
This commit is contained in:
Eli Schwartz 2019-10-23 22:31:36 -04:00
parent a3dbdf7875
commit cbf7bd49df
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -222,7 +222,7 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
cols = [] cols = []
if fm is not None: if fm is not None:
for key in sorted(displayable_columns(fm), for key in sorted(displayable_columns(fm),
key=lambda k: sort_key(fm[k]['name']) if k != color_row_key else 0): key=lambda k: sort_key(fm[k]['name'] if k != color_row_key else 0)):
if key == color_row_key and not self.coloring: if key == color_row_key and not self.coloring:
continue continue
from calibre.gui2.preferences.coloring import all_columns_string from calibre.gui2.preferences.coloring import all_columns_string