Disable rate limiting if billing is not enabled

This commit is contained in:
sabaimran 2024-06-12 21:39:02 +05:30
parent 45e725ac9c
commit 7e4a61f2ac

View file

@ -788,6 +788,10 @@ class ApiUserRateLimiter:
self.slug = slug
def __call__(self, request: Request):
# Rate limiting disabled if billing is disabled
if state.billing_enabled is False:
return
# Rate limiting is disabled if user unauthenticated.
# Other systems handle authentication
if not request.user.is_authenticated: