@@ -471,7 +471,10 @@ def retrieve(self, request, slug, project_id, pk=None):
471471 ArrayAgg (
472472 "labels__id" ,
473473 distinct = True ,
474- filter = ~ Q (labels__id__isnull = True ),
474+ filter = (
475+ ~ Q (labels__id__isnull = True )
476+ & Q (labels__deleted_at__isnull = True )
477+ ),
475478 ),
476479 Value ([], output_field = ArrayField (UUIDField ())),
477480 ),
@@ -489,7 +492,8 @@ def retrieve(self, request, slug, project_id, pk=None):
489492 "issue_module__module_id" ,
490493 distinct = True ,
491494 filter = ~ Q (issue_module__module_id__isnull = True )
492- & Q (issue_module__module__archived_at__isnull = True ),
495+ & Q (issue_module__module__archived_at__isnull = True )
496+ & Q (issue_module__module__deleted_at__isnull = True ),
493497 ),
494498 Value ([], output_field = ArrayField (UUIDField ())),
495499 ),
@@ -568,7 +572,10 @@ def partial_update(self, request, slug, project_id, pk=None):
568572 ArrayAgg (
569573 "labels__id" ,
570574 distinct = True ,
571- filter = ~ Q (labels__id__isnull = True ),
575+ filter = (
576+ ~ Q (labels__id__isnull = True )
577+ & Q (labels__deleted_at__isnull = True )
578+ ),
572579 ),
573580 Value ([], output_field = ArrayField (UUIDField ())),
574581 ),
@@ -585,7 +592,9 @@ def partial_update(self, request, slug, project_id, pk=None):
585592 ArrayAgg (
586593 "issue_module__module_id" ,
587594 distinct = True ,
588- filter = ~ Q (issue_module__module_id__isnull = True ),
595+ filter = ~ Q (issue_module__module_id__isnull = True )
596+ & Q (issue_module__module__archived_at__isnull = True )
597+ & Q (issue_module__module__deleted_at__isnull = True ),
589598 ),
590599 Value ([], output_field = ArrayField (UUIDField ())),
591600 ),
@@ -855,7 +864,10 @@ def list(self, request, slug, project_id):
855864 ArrayAgg (
856865 "labels__id" ,
857866 distinct = True ,
858- filter = ~ Q (labels__id__isnull = True ),
867+ filter = (
868+ ~ Q (labels__id__isnull = True )
869+ & Q (labels__deleted_at__isnull = True )
870+ ),
859871 ),
860872 Value ([], output_field = ArrayField (UUIDField ())),
861873 ),
@@ -873,7 +885,8 @@ def list(self, request, slug, project_id):
873885 "issue_module__module_id" ,
874886 distinct = True ,
875887 filter = ~ Q (issue_module__module_id__isnull = True )
876- & Q (issue_module__module__archived_at__isnull = True ),
888+ & Q (issue_module__module__archived_at__isnull = True )
889+ & Q (issue_module__module__deleted_at__isnull = True ),
877890 ),
878891 Value ([], output_field = ArrayField (UUIDField ())),
879892 ),
0 commit comments