From 4eb56c860b43f1d808d6bb83c816e855e7d26d27 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 9 Mar 2024 08:05:56 +0200 Subject: [PATCH] dont notify jannies of draft effortposts until they're published --- files/routes/posts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 6d3727d58..cbb9ab876 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -92,6 +92,10 @@ def publish(pid, v): execute_snappy(p, v) + if flag_effortpost and not (SITE_NAME == 'WPD' and v.truescore < 500): + body = f"@{v.username} has requested that {p.textlink} be marked as an effortpost!" + alert_admins(body) + return {"message": "Post has been published successfully!"} @app.get("/submit") @@ -734,7 +738,7 @@ def submit_post(v, hole=None): generate_thumb = (not p.thumburl and p.url and p.domain != SITE) gevent.spawn(postprocess_post, p.url, p.body, p.body_html, p.id, generate_thumb, False) - if flag_effortpost and not (SITE_NAME == 'WPD' and v.truescore < 500): + if not p.draft and flag_effortpost and not (SITE_NAME == 'WPD' and v.truescore < 500): body = f"@{v.username} has requested that {p.textlink} be marked as an effortpost!" alert_admins(body)