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 ee823d2 commit 9572f02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apiserver/plane/app/views/workspace/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def create_draft_to_issue(self, request, slug, draft_id):
{
"updated_cycle_issues": None,
"created_cycle_issues": serializers.serialize(
"json", created_records
"json", [created_records]
),
}
),
Expand Down
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 9572f02

Please sign in to comment.