Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-2631] chore: changed the cascading logic for soft delete #5829

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 == models.CASCADE
):
if field.one_to_many:
related_objects = getattr(instance, field.name).all()
Expand Down
2 changes: 1 addition & 1 deletion apiserver/plane/db/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class ProjectBaseModel(BaseModel):
Project, on_delete=models.CASCADE, related_name="project_%(class)s"
)
workspace = models.ForeignKey(
"db.Workspace", models.CASCADE, related_name="workspace_%(class)s"
"db.Workspace", on_delete=models.CASCADE, related_name="workspace_%(class)s"
)

class Meta:
Expand Down
Loading