mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
newdb: Fix default value for identifiers is mutable
This commit is contained in:
parent
8713ebb0b1
commit
e2c3bb40a5
@ -410,6 +410,9 @@ class IdentifiersField(ManyToManyField):
|
||||
def for_book(self, book_id, default_value=None):
|
||||
ids = self.table.book_col_map.get(book_id, ())
|
||||
if not ids:
|
||||
try:
|
||||
ids = default_value.copy() # in case default_value is a mutable dict
|
||||
except AttributeError:
|
||||
ids = default_value
|
||||
return ids
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user