X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/145e56d0df5162f8b57574e5b5656c6354274280..cc9a57b827d7303c37f3b2d271e7c2f661d30e45:/apps/api/models.py?ds=sidebyside diff --git a/apps/api/models.py b/apps/api/models.py index 22e5648ac..2cdc74a4b 100644 --- a/apps/api/models.py +++ b/apps/api/models.py @@ -31,6 +31,7 @@ def _pre_delete_handler(sender, instance, **kwargs): category = instance.category else: category = None - Deleted.objects.create(type=sender, object_id=instance.id, + content_type = ContentType.objects.get_for_model(sender) + Deleted.objects.create(content_type=content_type, object_id=instance.id, created_at=instance.created_at, category=category) pre_delete.connect(_pre_delete_handler)