This commit is contained in:
Kovid Goyal 2024-09-29 22:19:35 +05:30
commit c10a718174
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -231,6 +231,9 @@ class Metadata:
# are returning a "real" Metadata instance that has __get_attribute__.
m = Metadata(None)
object.__setattr__(m, '_data', copy.deepcopy(object.__getattribute__(self, '_data')))
# Also copy these two top-level attributes as they can appear in templates.
object.__setattr__(m, 'id', copy.copy(self.get('id')))
object.__setattr__(m, 'has_cover', copy.copy(self.get('has_cover')))
return m
def get(self, field, default=None):