forked from rDrama/rDrama
fix logic for duplicate posts in localhost
parent
0aa27a926b
commit
d616086dbd
|
@ -724,15 +724,15 @@ def submit_post(v, sub=None):
|
||||||
if not url and not body and not request.files.get("file") and not request.files.get("file-url"):
|
if not url and not body and not request.files.get("file") and not request.files.get("file-url"):
|
||||||
return error("Please enter a url or some text.")
|
return error("Please enter a url or some text.")
|
||||||
|
|
||||||
dup = g.db.query(Submission).filter(
|
if SITE != 'localhost':
|
||||||
Submission.author_id == v.id,
|
dup = g.db.query(Submission).filter(
|
||||||
Submission.deleted_utc == 0,
|
Submission.author_id == v.id,
|
||||||
Submission.title == title,
|
Submission.deleted_utc == 0,
|
||||||
Submission.url == url,
|
Submission.title == title,
|
||||||
Submission.body == body
|
Submission.url == url,
|
||||||
).one_or_none()
|
Submission.body == body
|
||||||
|
).one_or_none()
|
||||||
if dup and SITE != 'localhost': return redirect(dup.permalink)
|
if dup: return redirect(dup.permalink)
|
||||||
|
|
||||||
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