chore: formatting and typo fixes

This commit is contained in:
sriram veeraghanta 2024-12-04 19:40:37 +05:30
parent fb3295f5f4
commit 3bccda0c86
15 changed files with 74 additions and 216 deletions

View file

@ -19,9 +19,9 @@ def soft_delete_related_objects(app_label, model_name, instance_pk, using=None):
try:
# Check if the field has CASCADE on delete
if (
hasattr(field, "remote_field") and
hasattr(field.remote_field, "on_delete") and
field.remote_field.on_delete == models.CASCADE
hasattr(field, "remote_field")
and hasattr(field.remote_field, "on_delete")
and field.remote_field.on_delete == models.CASCADE
):
if field.one_to_many:
related_objects = getattr(instance, field.name).all()