mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When getting identifiers for a book use a copy of the dict
Fixes #1945098 [5.28 Forgets or reverts identifiers](https://bugs.launchpad.net/calibre/+bug/1945098)
This commit is contained in:
parent
32e9dc32b2
commit
5bf68b5971
@ -577,8 +577,10 @@ class ManyToManyField(Field):
|
|||||||
class IdentifiersField(ManyToManyField):
|
class IdentifiersField(ManyToManyField):
|
||||||
|
|
||||||
def for_book(self, book_id, default_value=None):
|
def for_book(self, book_id, default_value=None):
|
||||||
ids = self.table.book_col_map.get(book_id, ())
|
ids = self.table.book_col_map.get(book_id, None)
|
||||||
if not ids:
|
if ids:
|
||||||
|
ids = ids.copy()
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
ids = default_value.copy() # in case default_value is a mutable dict
|
ids = default_value.copy() # in case default_value is a mutable dict
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user