From be796452db0f4a86a13a948c9fdac9fd91bb198a Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 6 Aug 2023 10:30:34 +0300 Subject: [PATCH] dedup DEFAULT_RATELIMIT --- files/routes/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 8124cca0d..0711795a9 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -80,8 +80,8 @@ def edit_rules_get(v): @app.post('/admin/edit_rules') @limiter.limit('1/second', scope=rpath) @limiter.limit('1/second', scope=rpath, key_func=get_ID) -@limiter.limit("30/minute;200/hour;1000/day", deduct_when=lambda response: response.status_code < 400) -@limiter.limit("30/minute;200/hour;1000/day", deduct_when=lambda response: response.status_code < 400, key_func=get_ID) +@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) +@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @admin_level_required(PERMS['EDIT_RULES']) def edit_rules_post(v): rules = request.values.get('rules', '').strip()