From 1cacedf72e80df1def08abe87255d0815b0945cd Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 14 Jul 2023 14:43:40 +0300 Subject: [PATCH] remove mass_css_validation_holes --- files/routes/admin.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index e6427aebe..7a487231a 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -26,25 +26,6 @@ from files.routes.routehelpers import get_alt_graph, get_alt_graph_ids from .front import frontlist, comment_idlist -@app.get('/admin/mass_css_validation_holes') -@limiter.limit(DEFAULT_RATELIMIT) -@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) -@admin_level_required(5) -def mass_css_validation_holes(v): - holes = g.db.query(Sub).filter(Sub.css != None) - for h in holes: - print(f'processing {h.name}', flush=True) - for i in css_url_regex.finditer(h.css): - url = i.group(1) - if not is_safe_url(url): - print(f"wiped {h.name}\n{h.css}", flush=True) - with open(f"wipe-holes.log", "a", encoding="utf-8") as f: - f.write(f'{h.name}\n{h.css}\n\n\n') - h.css = None - g.db.add(h) - break - return 'success' - @app.get('/admin/loggedin') @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)