fix repost-detection in /submit

master
Aevann 2023-03-06 02:00:01 +02:00
parent 3ac75b2ac7
commit ce501ddf05
1 changed files with 3 additions and 2 deletions

View File

@ -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")