give chadmins notifications for unbans and unremovals

master
Aevann1 2022-06-13 16:40:16 +02:00
parent cf827bdf38
commit ba883a5340
1 changed files with 9 additions and 1 deletions

View File

@ -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)
return redirect(user.url)