When serialize_data=True, a DoesNotExist error occurs during deletion if the defer field is present.
This happens because, with serialize_data=True, it tries to retrieve all fields not listed in serialize_kwargs['fields'], but the record has already been deleted.
|
for field in instance_copy._meta.fields: |
It should only attempt to retrieve fields that are explicitly listed in serialize_kwargs['fields'].