mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-17 00:16:43 +01:00
newdb: Fix default value for identifiers is mutable
This commit is contained in:
parent
8713ebb0b1
commit
e2c3bb40a5
1 changed files with 4 additions and 1 deletions
|
|
@ -410,7 +410,10 @@ class IdentifiersField(ManyToManyField):
|
|||
def for_book(self, book_id, default_value=None):
|
||||
ids = self.table.book_col_map.get(book_id, ())
|
||||
if not ids:
|
||||
ids = default_value
|
||||
try:
|
||||
ids = default_value.copy() # in case default_value is a mutable dict
|
||||
except AttributeError:
|
||||
ids = default_value
|
||||
return ids
|
||||
|
||||
def sort_keys_for_books(self, get_metadata, lang_map, all_book_ids):
|
||||
|
|
|
|||
Loading…
Reference in a new issue