Fix for flask limiter 4.0

Fix reseting flask_limiter keys
This commit is contained in:
Ozzie Isaacs
2026-02-18 18:59:29 +01:00
parent cabcace3f0
commit e3bf369ad6
7 changed files with 128 additions and 183 deletions
+1 -3
View File
@@ -46,11 +46,10 @@ 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
kobo = kobo_auth = get_remote_address = None
kobo = kobo_auth = None
try:
from .oauth_bb import oauth
@@ -77,7 +76,6 @@ def main():
app.register_blueprint(gdrive)
app.register_blueprint(editbook)
if kobo_available:
limiter.limit("3/minute", key_func=get_remote_address)(kobo)
app.register_blueprint(kobo)
app.register_blueprint(kobo_auth)
if oauth_available: