Skip to content

Commit

Permalink
chore: draft issue listing
Browse files Browse the repository at this point in the history
  • Loading branch information
NarayanBavisetti committed Oct 20, 2024
1 parent db91942 commit cfc5086
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
6 changes: 1 addition & 5 deletions apiserver/plane/api/views/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,7 @@ def delete(self, request, slug, project_id, pk):
epoch=int(timezone.now().timestamp()),
)
# Delete the cycle
cycle.delete()
# Delete the cycle issues
CycleIssue.objects.filter(
cycle_id=self.kwargs.get("pk"),
).delete()
cycle.delete(soft=False)
# Delete the user favorite cycle
UserFavorite.objects.filter(
entity_type="cycle",
Expand Down
9 changes: 3 additions & 6 deletions apiserver/plane/app/views/cycle/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,9 @@ def destroy(self, request, slug, project_id, pk):
notification=True,
origin=request.META.get("HTTP_ORIGIN"),
)
# Delete the cycle
cycle.delete()
# Delete the cycle issues
CycleIssue.objects.filter(
cycle_id=self.kwargs.get("pk"),
).delete()
# TODO: Soft delete the cycle break the onetoone relationship with cycle issue
cycle.delete(soft=False)

# Delete the user favorite cycle
UserFavorite.objects.filter(
user=request.user,
Expand Down
4 changes: 2 additions & 2 deletions apiserver/plane/app/views/workspace/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def get_queryset(self):
.annotate(
cycle_id=Case(
When(
issue_cycle__cycle__deleted_at__isnull=True,
then=F("issue_cycle__cycle_id"),
draft_issue_cycle__cycle__deleted_at__isnull=True,
then=F("draft_issue_cycle__cycle_id"),
),
default=None,
)
Expand Down

0 comments on commit cfc5086

Please sign in to comment.