Skip to content

Commit

Permalink
fix: Fix deactivated enterprise user when no plan activated users
Browse files Browse the repository at this point in the history
  • Loading branch information
suejung-sentry committed Jan 9, 2025
1 parent 8660eab commit ec18bbd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions graphql_api/types/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ async def resolve_owner(
if settings.IS_ENTERPRISE and settings.GUEST_ACCESS is False:
if not user or not user.is_authenticated:
raise UnauthorizedGuestAccess()

target = await get_owner(service, username)
if user.ownerid not in target.plan_activated_users:
target_owner = await get_owner(service, username)
has_plan_activated_users = target_owner and target_owner.plan_activated_users is not None
if has_plan_activated_users and user.ownerid not in target_owner.plan_activated_users:
raise UnauthorizedGuestAccess()

return await get_owner(service, username)
Expand Down

0 comments on commit ec18bbd

Please sign in to comment.