From 802af2418a5bd9c6d95d8d6df641777507a42a08 Mon Sep 17 00:00:00 2001 From: Joachim Lusiardi Date: Mon, 17 Apr 2023 21:25:02 +0200 Subject: [PATCH] remove limitter --- app/__init__.py | 8 -------- app/routes/filling_stations.py | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index ca9660d..9311e7d 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -6,7 +6,6 @@ from flask_sqlalchemy import SQLAlchemy import os from config import config from flask_security.forms import LoginForm -from flask_limiter import Limiter from flask_limiter.util import get_remote_address from .forms import * @@ -15,13 +14,6 @@ from .forms import * app = Flask(__name__) app.config.from_object(config[os.getenv('FLASK_CONFIG') or 'default']) -# applies to all routes, so choose limits wisely! -limiter = Limiter( - app, - key_func=get_remote_address, -# default_limits=["500 per second"] -) - @app.errorhandler(429) def ratelimit_handler(e): diff --git a/app/routes/filling_stations.py b/app/routes/filling_stations.py index 11d0b7e..b4086fb 100644 --- a/app/routes/filling_stations.py +++ b/app/routes/filling_stations.py @@ -4,7 +4,7 @@ from flask_security.core import current_user import requests from ..entities import FillingStation -from .. import app, db, limiter +from .. import app, db @app.route('/filling_stations/favourites/toggle/') @@ -24,7 +24,6 @@ def add_favourite_filling_stations(fsid): @app.route('/filling_stations', methods=['GET']) @login_required -@limiter.limit('1 per second') def query_filling_stations(): api_key = app.config['TANKERKOENIG_API_KEY']