Skip to content

Commit

Permalink
chore: changed the cascading logic for soft delete
Browse files Browse the repository at this point in the history
  • Loading branch information
NarayanBavisetti committed Oct 14, 2024
1 parent 701af73 commit 1f5cbe9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apiserver/plane/bgtasks/deletion_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def soft_delete_related_objects(
try:
# Check if the field has CASCADE on delete
if (
hasattr(field.remote_field, "on_delete")
and field.remote_field.on_delete == models.CASCADE
not hasattr(field.remote_field, "on_delete")
or field.remote_field.on_delete == "CASCADE"
):
if field.one_to_many:
related_objects = getattr(instance, field.name).all()
Expand Down

0 comments on commit 1f5cbe9

Please sign in to comment.