Bugfix ratelimiter kobo

This commit is contained in:
Ozzieisaacs
2022-09-05 18:45:24 +02:00
parent 6598c4d259
commit 2472e03a69
3 changed files with 10 additions and 3 deletions

View File

@@ -44,6 +44,7 @@ def main():
try:
from .kobo import kobo, get_kobo_activated
from .kobo_auth import kobo_auth
from flask_limiter.util import get_remote_address
kobo_available = get_kobo_activated()
except (ImportError, AttributeError): # Catch also error for not installed flask-WTF (missing csrf decorator)
kobo_available = False
@@ -73,6 +74,7 @@ def main():
if kobo_available:
app.register_blueprint(kobo)
app.register_blueprint(kobo_auth)
limiter.limit("10/minute", key_func=get_remote_address)(kobo)
if oauth_available:
app.register_blueprint(oauth)
success = web_server.start()