From ce501ddf05c6407c035a7f8b343336c3b6d426ad Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 6 Mar 2023 02:00:01 +0200 Subject: [PATCH] fix repost-detection in /submit --- files/routes/posts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 0fced7792..95706906c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -513,7 +513,7 @@ def submit_post(v:User, sub=None): Submission.is_banned == False ).first() if repost and FEATURES['REPOST_DETECTION'] and not v.admin_level >= PERMS['POST_BYPASS_REPOST_CHECKING']: - return redirect(repost.permalink) + return {"post_id": repost.id} y = tldextract.extract(url).registered_domain + parsed_url.path y = y.lower() @@ -546,7 +546,8 @@ def submit_post(v:User, sub=None): Submission.url == url, Submission.body == body ).one_or_none() - if dup: return redirect(dup.permalink) + if dup: + return {"post_id": dup.id} if not execute_antispam_submission_check(title, v, url): return redirect("/notifications")