ignore only pv limit exceeded on subscribe (#3470)

pull/3471/head r2023.10.30-223
RobertJoonas 3 years ago committed by GitHub
parent 8cc7bce689
commit 3c76053c3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -190,8 +190,17 @@ defmodule Plausible.Billing.Quota do
def ensure_can_subscribe_to_plan(user, %Plan{} = plan) do
case exceeded_limits(usage(user), plan) do
[] -> :ok
exceeded_limits -> {:error, %{exceeded_limits: exceeded_limits}}
[] ->
:ok
[:monthly_pageview_limit] ->
# This is a quick fix. Need to figure out how to handle this case. Only
# checking the last 30 days usage is not accurate enough. Needs to be
# in sync with the actual locking system.
:ok
exceeded_limits ->
{:error, %{exceeded_limits: exceeded_limits}}
end
end

Loading…
Cancel
Save