|
@@ -181,18 +181,7 @@ class OrganizationGroupIndexEndpoint(OrganizationEventsEndpointBase):
|
|
|
assert "environment" not in extra_query_kwargs
|
|
|
query_kwargs.update(extra_query_kwargs)
|
|
|
|
|
|
- if query_kwargs["sort_by"] == "better priority":
|
|
|
- if not features.has(
|
|
|
- "organizations:issue-list-better-priority-sort",
|
|
|
- organization,
|
|
|
- actor=request.user,
|
|
|
- ):
|
|
|
- return self.respond(
|
|
|
- {
|
|
|
- "error": "This organization does not have the better priority sort feature."
|
|
|
- },
|
|
|
- status=403,
|
|
|
- )
|
|
|
+ if query_kwargs["sort_by"] == "betterPriority":
|
|
|
query_kwargs["aggregate_kwargs"] = self.build_better_priority_sort_kwargs(request)
|
|
|
|
|
|
query_kwargs["environments"] = environments if environments else None
|
|
@@ -250,6 +239,14 @@ class OrganizationGroupIndexEndpoint(OrganizationEventsEndpointBase):
|
|
|
:qparam list expand: an optional list of strings to opt in to additional data. Supports `inbox`
|
|
|
:qparam list collapse: an optional list of strings to opt out of certain pieces of data. Supports `stats`, `lifetime`, `base`
|
|
|
"""
|
|
|
+
|
|
|
+ if request.GET.get("sort") == "betterPriority" and not features.has(
|
|
|
+ "organizations:issue-list-better-priority-sort", organization, actor=request.user
|
|
|
+ ):
|
|
|
+ return Response(
|
|
|
+ {"detail": "This organization does not have the better priority sort feature."},
|
|
|
+ status=400,
|
|
|
+ )
|
|
|
stats_period = request.GET.get("groupStatsPeriod")
|
|
|
try:
|
|
|
start, end = get_date_range_from_stats_period(request.GET)
|