chore: formatting and typo fixes
This commit is contained in:
parent
fb3295f5f4
commit
3bccda0c86
15 changed files with 74 additions and 216 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue