From 514b7bfa7f6ab3569f49c7e7275d3706744c77a0 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 9 Mar 2023 22:50:12 +0200 Subject: [PATCH] ratelimit /delete_media and notify me of its usage --- files/helpers/config/modaction_types.py | 3 ++- files/routes/admin.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/files/helpers/config/modaction_types.py b/files/helpers/config/modaction_types.py index 79cf9a442c..1d3905a5c5 100644 --- a/files/helpers/config/modaction_types.py +++ b/files/helpers/config/modaction_types.py @@ -408,4 +408,5 @@ MODACTION_TYPES__FILTERED = deepcopy({t:v for t,v in MODACTION_TYPES.items() AEVANN_MODACTION_TYPES = {'ban_user','unban_user', 'shadowban','unshadowban', 'progstack_post','progstack_comment', - 'unprogstack_post', 'unprogstack_comment'} + 'unprogstack_post', 'unprogstack_comment', + 'delete_media'} diff --git a/files/routes/admin.py b/files/routes/admin.py index b59fada525..d88cc268b6 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1754,8 +1754,8 @@ def delete_media_get(v): @app.post("/admin/delete_media") @limiter.limit('1/second', scope=rpath) -@limiter.limit(DEFAULT_RATELIMIT) -@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) +@limiter.limit("50/day") +@limiter.limit("50/day", key_func=get_ID) @admin_level_required(PERMS['DELETE_MEDIA']) def delete_media_post(v):