diff --git a/sync/signals.py b/sync/signals.py index ed28521..a0bbcb0 100644 --- a/sync/signals.py +++ b/sync/signals.py @@ -257,8 +257,9 @@ def process_foreign_key_changes(sender, instance, **kwargs): def delete_data_access_if_necessary(sender, instance, **kwargs): if not isinstance(instance, BaseModel): return - # if hasattr(instance, 'id'): - # DataAccess.objects.filter(model_id=instance.id).delete() + if hasattr(instance, 'id'): + for data_access in DataAccess.objects.filter(model_id=instance.id): + data_access.create_revoke_access_log() @receiver(m2m_changed, sender=DataAccess.shared_with.through) def handle_shared_with_changes(sender, instance, action, pk_set, **kwargs):