mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(portal): don't count internet site in limits (#10336)
Starter plans don't have access to the internet site so it's not fair to count it against their limits. Related: https://app.hubspot.com/contacts/23723443/record/0-5/29628021256
This commit is contained in:
@@ -23,6 +23,7 @@ defmodule Domain.Gateways do
|
||||
def count_groups_for_account(%Accounts.Account{} = account) do
|
||||
Group.Query.not_deleted()
|
||||
|> Group.Query.by_account_id(account.id)
|
||||
|> Group.Query.by_managed_by(:account)
|
||||
|> Repo.aggregate(:count)
|
||||
end
|
||||
|
||||
|
||||
@@ -37,6 +37,11 @@ defmodule Domain.GatewaysTest do
|
||||
|
||||
assert count_groups_for_account(account) == 0
|
||||
end
|
||||
|
||||
test "does not count internet site", %{account: account} do
|
||||
Fixtures.Gateways.create_internet_group(account: account)
|
||||
assert count_groups_for_account(account) == 0
|
||||
end
|
||||
end
|
||||
|
||||
describe "fetch_group_by_id/3" do
|
||||
|
||||
Reference in New Issue
Block a user