Skip to content

Commit

Permalink
chore: handling the archived module ids in the issue list and issue d…
Browse files Browse the repository at this point in the history
…etail endpoints (#5343)
  • Loading branch information
gurusainath authored Aug 9, 2024
1 parent 24b1e71 commit f457048
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion apiserver/plane/app/views/inbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def get_queryset(self):
ArrayAgg(
"issue_module__module_id",
distinct=True,
filter=~Q(issue_module__module_id__isnull=True),
filter=~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True),
),
Value([], output_field=ArrayField(UUIDField())),
),
Expand Down
5 changes: 2 additions & 3 deletions apiserver/plane/app/views/issue/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@


class IssueListEndpoint(BaseAPIView):

permission_classes = [
ProjectEntityPermission,
]
Expand Down Expand Up @@ -438,7 +437,8 @@ def retrieve(self, request, slug, project_id, pk=None):
ArrayAgg(
"issue_module__module_id",
distinct=True,
filter=~Q(issue_module__module_id__isnull=True),
filter=~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True),
),
Value([], output_field=ArrayField(UUIDField())),
),
Expand Down Expand Up @@ -626,7 +626,6 @@ def delete(self, request, slug, project_id):
project_id=project_id,
is_active=True,
).exists():

return Response(
{"error": "Only admin can perform this action"},
status=status.HTTP_403_FORBIDDEN,
Expand Down
3 changes: 2 additions & 1 deletion apiserver/plane/app/views/view/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def get_queryset(self):
ArrayAgg(
"issue_module__module_id",
distinct=True,
filter=~Q(issue_module__module_id__isnull=True),
filter=~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True),
),
Value([], output_field=ArrayField(UUIDField())),
),
Expand Down
7 changes: 4 additions & 3 deletions apiserver/plane/utils/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


def issue_queryset_grouper(queryset, group_by, sub_group_by):

FIELD_MAPPER = {
"label_ids": "labels__id",
"assignee_ids": "assignees__id",
Expand All @@ -30,7 +29,10 @@ def issue_queryset_grouper(queryset, group_by, sub_group_by):
"label_ids": ("labels__id", ~Q(labels__id__isnull=True)),
"module_ids": (
"issue_module__module_id",
~Q(issue_module__module_id__isnull=True),
(
~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True)
),
),
}
default_annotations = {
Expand All @@ -51,7 +53,6 @@ def issue_queryset_grouper(queryset, group_by, sub_group_by):


def issue_on_results(issues, group_by, sub_group_by):

FIELD_MAPPER = {
"labels__id": "label_ids",
"assignees__id": "assignee_ids",
Expand Down

0 comments on commit f457048

Please sign in to comment.