chore: soft deletion of cycle and module (#5884)
* chore: soft deletion of cycle and module * chore: cycle module soft delete * chore: added the deletion task * chore: updated the env example * chore: cycle issue unique constraints * chore: udpated the Q operator
This commit is contained in:
parent
00eff43f4d
commit
7bf4620bc1
31 changed files with 317 additions and 141 deletions
|
|
@ -404,7 +404,7 @@ class CycleAPIEndpoint(BaseAPIView):
|
|||
epoch=int(timezone.now().timestamp()),
|
||||
)
|
||||
# Delete the cycle
|
||||
cycle.delete(soft=False)
|
||||
cycle.delete()
|
||||
# Delete the user favorite cycle
|
||||
UserFavorite.objects.filter(
|
||||
entity_type="cycle",
|
||||
|
|
|
|||
|
|
@ -227,7 +227,10 @@ class InboxIssueAPIEndpoint(BaseAPIView):
|
|||
ArrayAgg(
|
||||
"labels__id",
|
||||
distinct=True,
|
||||
filter=~Q(labels__id__isnull=True),
|
||||
filter=Q(
|
||||
~Q(labels__id__isnull=True)
|
||||
& Q(label_issue__deleted_at__isnull=True),
|
||||
),
|
||||
),
|
||||
Value([], output_field=ArrayField(UUIDField())),
|
||||
),
|
||||
|
|
@ -235,7 +238,11 @@ class InboxIssueAPIEndpoint(BaseAPIView):
|
|||
ArrayAgg(
|
||||
"assignees__id",
|
||||
distinct=True,
|
||||
filter=~Q(assignees__id__isnull=True),
|
||||
filter=Q(
|
||||
~Q(assignees__id__isnull=True)
|
||||
& Q(assignees__member_project__is_active=True)
|
||||
& Q(issue_assignee__deleted_at__isnull=True)
|
||||
),
|
||||
),
|
||||
Value([], output_field=ArrayField(UUIDField())),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ class IssueAPIEndpoint(BaseAPIView):
|
|||
.annotate(
|
||||
cycle_id=Case(
|
||||
When(
|
||||
Q(issue_cycle__cycle__deleted_at__isnull=True),
|
||||
Q(issue_cycle__deleted_at__isnull=True),
|
||||
then=F("issue_cycle__cycle_id"),
|
||||
),
|
||||
default=None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue