Merge pull request #1560 from makeplane/sync/ce-ee

Sync: Community Changes
This commit is contained in:
pushya22
2024-10-21 13:04:04 +05:30
committed by GitHub
3 changed files with 6 additions and 13 deletions

View File

@@ -404,11 +404,7 @@ class CycleAPIEndpoint(BaseAPIView):
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",

View File

@@ -498,12 +498,9 @@ class CycleViewSet(BaseViewSet):
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,

View File

@@ -61,8 +61,8 @@ class WorkspaceDraftIssueViewSet(BaseViewSet):
.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,
)