From db0a881326b55a5bc24b916d8ebe82f934ef8a69 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 1 Feb 2022 01:10:22 +0200 Subject: [PATCH] df --- files/routes/oauth.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/files/routes/oauth.py b/files/routes/oauth.py index a88778361..f45c21d8d 100644 --- a/files/routes/oauth.py +++ b/files/routes/oauth.py @@ -52,19 +52,7 @@ def request_api_keys(v): text_html = sanitize(text, noimages=True) - new_comment = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=None, - level=1, - sentto=0, - body_html=text_html, - ) - g.db.add(new_comment) - g.db.flush() - - admins = g.db.query(User).filter(User.admin_level > 2).all() - for admin in admins: - notif = Notification(comment_id=new_comment.id, user_id=admin.id) - g.db.add(notif) + send_admin(NOTIFICATIONS_ID, text_html) g.db.commit() @@ -114,7 +102,7 @@ def edit_oauth_app(v, aid): @app.post("/admin/app/approve/") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(2) +@admin_level_required(3) def admin_app_approve(v, aid): app = g.db.query(OauthApp).filter_by(id=aid).one_or_none()