mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle people with legacy databases that have custom columns with non ascii search names. Fixes #781490 (KeyError happens whenever I click on a book in the main screen (list))
This commit is contained in:
parent
8c6c5c668f
commit
da90da98e3
@ -112,10 +112,15 @@ class Metadata(object):
|
|||||||
|
|
||||||
Be careful with numeric fields since this will return True for zero as
|
Be careful with numeric fields since this will return True for zero as
|
||||||
well as None.
|
well as None.
|
||||||
|
|
||||||
|
Also returns True if the field does not exist.
|
||||||
'''
|
'''
|
||||||
|
try:
|
||||||
null_val = NULL_VALUES.get(field, None)
|
null_val = NULL_VALUES.get(field, None)
|
||||||
val = getattr(self, field, None)
|
val = getattr(self, field, None)
|
||||||
return not val or val == null_val
|
return not val or val == null_val
|
||||||
|
except:
|
||||||
|
return True
|
||||||
|
|
||||||
def __getattribute__(self, field):
|
def __getattribute__(self, field):
|
||||||
_data = object.__getattribute__(self, '_data')
|
_data = object.__getattribute__(self, '_data')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user