forked from MarseyWorld/MarseyWorld
fix logic for duplicate posts in localhost
parent
0aa27a926b
commit
d616086dbd
|
@ -724,6 +724,7 @@ 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"):
|
||||
return error("Please enter a url or some text.")
|
||||
|
||||
if SITE != 'localhost':
|
||||
dup = g.db.query(Submission).filter(
|
||||
Submission.author_id == v.id,
|
||||
Submission.deleted_utc == 0,
|
||||
|
@ -731,8 +732,7 @@ def submit_post(v, sub=None):
|
|||
Submission.url == url,
|
||||
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):
|
||||
return redirect("/notifications")
|
||||
|
|
Loading…
Reference in New Issue