Skip to content

Commit b154c98

Browse files
ref: handle AnonymousUser in organization_index (#91562)
new django-stubs properly types `AnonymousUser.id` -- this fixes the usage in this view <!-- Describe your PR here. -->
1 parent 3ceeacd commit b154c98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sentry/api/endpoints/organization_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get(self, request: Request) -> Response:
105105
elif request.auth.organization_id is not None:
106106
queryset = queryset.filter(id=request.auth.organization_id)
107107

108-
elif owner_only:
108+
elif owner_only and request.user.is_authenticated:
109109
# This is used when closing an account
110110

111111
# also fetches organizations in which you are a member of an owner team

0 commit comments

Comments
 (0)