Skip to content

Commit

Permalink
account for empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
suejung-sentry committed Jan 10, 2025
1 parent 79341b5 commit 4220430
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion graphql_api/types/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ async def resolve_owner(
if settings.IS_ENTERPRISE and settings.GUEST_ACCESS is False:
if not user or not user.is_authenticated:
raise UnauthorizedGuestAccess()

# if the owner tracks plan activated users, check if the user is in the list
target_owner = await get_owner(service, username)
has_plan_activated_users = (
target_owner and target_owner.plan_activated_users is not None
target_owner
and target_owner.plan_activated_users is not None
and len(target_owner.plan_activated_users) > 0
)
if (
has_plan_activated_users
Expand Down

0 comments on commit 4220430

Please sign in to comment.