diff --git a/frappe/rate_limiter.py b/frappe/rate_limiter.py index 023cdb9cb0..528e5d6b56 100644 --- a/frappe/rate_limiter.py +++ b/frappe/rate_limiter.py @@ -103,7 +103,7 @@ def rate_limit(key: str, limit: Union[int, Callable] = 5, seconds: int= 24*60*60 def wrapper(*args, **kwargs): # Do not apply rate limits if method is not opted to check if methods != 'ALL' and frappe.request.method.upper() not in methods: - return frappe.call(fun, **frappe.form_dict) + return frappe.call(fun, **frappe.form_dict or kwargs) _limit = limit() if callable(limit) else limit @@ -118,6 +118,6 @@ def rate_limit(key: str, limit: Union[int, Callable] = 5, seconds: int= 24*60*60 if value > _limit: frappe.throw(_("You hit the rate limit because of too many requests. Please try after sometime.")) - return frappe.call(fun, **frappe.form_dict) + return frappe.call(fun, **frappe.form_dict or kwargs) return wrapper return ratelimit_decorator