chore: draft issue listing (#5874)
This commit is contained in:
parent
db919420a7
commit
3c3fc7cd6d
3 changed files with 6 additions and 13 deletions
|
|
@ -404,11 +404,7 @@ class CycleAPIEndpoint(BaseAPIView):
|
||||||
epoch=int(timezone.now().timestamp()),
|
epoch=int(timezone.now().timestamp()),
|
||||||
)
|
)
|
||||||
# Delete the cycle
|
# Delete the cycle
|
||||||
cycle.delete()
|
cycle.delete(soft=False)
|
||||||
# Delete the cycle issues
|
|
||||||
CycleIssue.objects.filter(
|
|
||||||
cycle_id=self.kwargs.get("pk"),
|
|
||||||
).delete()
|
|
||||||
# Delete the user favorite cycle
|
# Delete the user favorite cycle
|
||||||
UserFavorite.objects.filter(
|
UserFavorite.objects.filter(
|
||||||
entity_type="cycle",
|
entity_type="cycle",
|
||||||
|
|
|
||||||
|
|
@ -490,12 +490,9 @@ class CycleViewSet(BaseViewSet):
|
||||||
notification=True,
|
notification=True,
|
||||||
origin=request.META.get("HTTP_ORIGIN"),
|
origin=request.META.get("HTTP_ORIGIN"),
|
||||||
)
|
)
|
||||||
# Delete the cycle
|
# TODO: Soft delete the cycle break the onetoone relationship with cycle issue
|
||||||
cycle.delete()
|
cycle.delete(soft=False)
|
||||||
# Delete the cycle issues
|
|
||||||
CycleIssue.objects.filter(
|
|
||||||
cycle_id=self.kwargs.get("pk"),
|
|
||||||
).delete()
|
|
||||||
# Delete the user favorite cycle
|
# Delete the user favorite cycle
|
||||||
UserFavorite.objects.filter(
|
UserFavorite.objects.filter(
|
||||||
user=request.user,
|
user=request.user,
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@ class WorkspaceDraftIssueViewSet(BaseViewSet):
|
||||||
.annotate(
|
.annotate(
|
||||||
cycle_id=Case(
|
cycle_id=Case(
|
||||||
When(
|
When(
|
||||||
issue_cycle__cycle__deleted_at__isnull=True,
|
draft_issue_cycle__cycle__deleted_at__isnull=True,
|
||||||
then=F("issue_cycle__cycle_id"),
|
then=F("draft_issue_cycle__cycle_id"),
|
||||||
),
|
),
|
||||||
default=None,
|
default=None,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue