From ba883a5340eb786a7acac80d85f777db62dab030 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 13 Jun 2022 16:40:16 +0200 Subject: [PATCH] give chadmins notifications for unbans and unremovals --- files/routes/admin.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index ac55c4577..7117ca65e 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1012,6 +1012,7 @@ def unshadowban(user_id, v): g.db.add(ma) cache.delete_memoized(frontlist) + notify_mod_action(v.id, f"@{v.username} has unshadowbanned @{user.username}") g.db.commit() return {"message": "User unshadowbanned!"} @@ -1160,6 +1161,7 @@ def unban_user(user_id, v): ) g.db.add(ma) + notify_mod_action(v.id, f"@{v.username} has unbanned @{user.username} ({note})") g.db.commit() if "@" in request.referrer: return redirect(user.url) @@ -1239,6 +1241,9 @@ def unban_post(post_id, v): v.coins -= 1 g.db.add(v) + if v.id != post.author_id: + notify_mod_action(v.id, f"@{v.username} has approved [{post.title}]({post.shortlink})") + g.db.commit() return {"message": "Post approved!"} @@ -1435,6 +1440,9 @@ def api_unban_comment(c_id, v): g.db.add(comment) + if v.id != comment.author_id: + notify_mod_action(v.id, f"@{v.username} has approved [comment]({comment.shortlink})") + g.db.commit() return {"message": "Comment approved!"} @@ -1593,4 +1601,4 @@ def admin_nunuke_user(v): g.db.commit() - return redirect(user.url) \ No newline at end of file + return redirect(user.url)