Skip to content

Commit

Permalink
ref: fix typing for organization_teams (#79750)
Browse files Browse the repository at this point in the history
<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored Oct 25, 2024
1 parent c2e7b01 commit 5ff9706
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ module = [
"sentry.api.endpoints.organization_search_details",
"sentry.api.endpoints.organization_sessions",
"sentry.api.endpoints.organization_stats",
"sentry.api.endpoints.organization_teams",
"sentry.api.endpoints.project_index",
"sentry.api.endpoints.project_ownership",
"sentry.api.endpoints.project_release_files",
Expand Down
10 changes: 6 additions & 4 deletions src/sentry/api/endpoints/organization_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,18 @@ def get(self, request: Request, organization) -> Response:
)

elif key == "query":
value = " ".join(value)
queryset = queryset.filter(Q(name__icontains=value) | Q(slug__icontains=value))
joined_value = " ".join(value)
queryset = queryset.filter(
Q(name__icontains=joined_value) | Q(slug__icontains=joined_value)
)
elif key == "slug":
queryset = queryset.filter(slug__in=value)
elif key == "id":
try:
value = [int(item) for item in value]
int_values = [int(item) for item in value]
except ValueError:
raise ParseError(detail="Invalid id value")
queryset = queryset.filter(id__in=value)
queryset = queryset.filter(id__in=int_values)
else:
queryset = queryset.none()

Expand Down

0 comments on commit 5ff9706

Please sign in to comment.