From 79b5ad1ee28b451df9613e5bb59e459f48227c2e Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 6 Feb 2024 23:45:41 +0200 Subject: [PATCH] add position to NSFW code --- files/routes/posts.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index ef0af3840..c1cfb8743 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -789,6 +789,7 @@ def mark_post_nsfw(pid, v): target_post_id = p.id, ) g.db.add(ma) + position = 'a site admin' else: ma = HoleAction( hole = p.hole, @@ -797,7 +798,9 @@ def mark_post_nsfw(pid, v): target_post_id = p.id, ) g.db.add(ma) - send_repeatable_notification(p.author_id, f"@{v.username} (a site admin) has marked [{p.title}](/post/{p.id}) as NSFW") + position = f'a /h/{post.hole} mod' + + send_repeatable_notification(p.author_id, f"@{v.username} ({position}) has marked [{p.title}](/post/{p.id}) as NSFW") return {"message": "Post has been marked as NSFW!"} @@ -828,6 +831,7 @@ def unmark_post_nsfw(pid, v): target_post_id = p.id, ) g.db.add(ma) + position = 'a site admin' else: ma = HoleAction( hole = p.hole, @@ -836,7 +840,9 @@ def unmark_post_nsfw(pid, v): target_post_id = p.id, ) g.db.add(ma) - send_repeatable_notification(p.author_id, f"@{v.username} (a site admin) has unmarked [{p.title}](/post/{p.id}) as NSFW") + position = f'a /h/{post.hole} mod' + + send_repeatable_notification(p.author_id, f"@{v.username} ({position}) has unmarked [{p.title}](/post/{p.id}) as NSFW") return {"message": "Post has been unmarked as NSFW!"}