- Deleted.objects.create(type=sender.__name__, object_id=instance.id, created_at=instance.created_at)
+ if sender == Tag:
+ if instance.category in ('book', 'set'):
+ return
+ else:
+ category = instance.category
+ else:
+ category = None
+ 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)