Skip to content

Commit

Permalink
Make HelpScout integration handle owner of multiple teams gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
zoldar committed Jan 28, 2025
1 parent 258f368 commit 1a9aac5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extra/lib/plausible/help_scout.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ defmodule Plausible.HelpScout do
plan = Billing.Plans.get_subscription_plan(team.subscription)
{team, team.subscription, plan}

{:error, :multiple_teams} ->
[team | _] = Plausible.Teams.Users.owned_teams(user)
team = Plausible.Teams.with_subscription(team)
plan = Billing.Plans.get_subscription_plan(team.subscription)
{team, team.subscription, plan}

{:error, :no_team} ->
{nil, nil, nil}
end
Expand Down

0 comments on commit 1a9aac5

Please sign in to comment.