fix repost-detection in /submit
parent
3ac75b2ac7
commit
ce501ddf05
|
@ -513,7 +513,7 @@ def submit_post(v:User, sub=None):
|
||||||
Submission.is_banned == False
|
Submission.is_banned == False
|
||||||
).first()
|
).first()
|
||||||
if repost and FEATURES['REPOST_DETECTION'] and not v.admin_level >= PERMS['POST_BYPASS_REPOST_CHECKING']:
|
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 = tldextract.extract(url).registered_domain + parsed_url.path
|
||||||
y = y.lower()
|
y = y.lower()
|
||||||
|
@ -546,7 +546,8 @@ def submit_post(v:User, sub=None):
|
||||||
Submission.url == url,
|
Submission.url == url,
|
||||||
Submission.body == body
|
Submission.body == body
|
||||||
).one_or_none()
|
).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):
|
if not execute_antispam_submission_check(title, v, url):
|
||||||
return redirect("/notifications")
|
return redirect("/notifications")
|
||||||
|
|
Loading…
Reference in New Issue