From c91f09b83f6207776c0f074e40db42215780395b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 20 Jun 2022 01:08:21 +0200 Subject: [PATCH] put author username in mod action notifs --- files/routes/admin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 4acdc999f..929d0d594 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1201,7 +1201,7 @@ def ban_post(post_id, v): g.db.add(v) if v.id != post.author_id: - notify_mod_action(v.id, f"@{v.username} has removed [{post.title}]({post.shortlink})") + notify_mod_action(v.id, f"@{v.username} has removed [{post.title}]({post.shortlink}) by @{post.author.username}") requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, json={'files': [f"{SITE_FULL}/logged_out/"]}, timeout=5) @@ -1243,7 +1243,7 @@ def unban_post(post_id, v): g.db.add(v) if v.id != post.author_id: - notify_mod_action(v.id, f"@{v.username} has approved [{post.title}]({post.shortlink})") + notify_mod_action(v.id, f"@{v.username} has approved [{post.title}]({post.shortlink}) by @{post.author.username}") g.db.commit() @@ -1410,7 +1410,7 @@ def api_ban_comment(c_id, v): g.db.add(ma) if v.id != comment.author_id: - notify_mod_action(v.id, f"@{v.username} has removed [comment]({comment.shortlink})") + notify_mod_action(v.id, f"@{v.username} has removed [comment]({comment.shortlink}) by @{comment.author.username}") g.db.commit() return {"message": "Comment removed!"} @@ -1442,7 +1442,7 @@ 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})") + notify_mod_action(v.id, f"@{v.username} has approved [comment]({comment.shortlink}) by @{comment.author.username}") g.db.commit()