Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

ignore only pv limit exceeded on subscribe (#3470)

RobertJoonas3c76053c3fcd
diff --git a/lib/plausible/billing/quota.ex b/lib/plausible/billing/quota.ex
index b429524cdb..cc5c6f37cc 100644
--- a/lib/plausible/billing/quota.ex
+++ b/lib/plausible/billing/quota.ex
@@ -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