use "post" instead of "submission" for consistency

master
Aevann 2023-05-14 23:38:09 +03:00
parent beb8adcda5
commit ada7c713ab
2 changed files with 5 additions and 5 deletions

View File

@ -196,7 +196,7 @@ def execute_blackjack(v, target, body, type):
extra_info = type
if target:
if type == 'submission':
if type == 'post':
extra_info = target.permalink
elif type == 'report':
extra_info = f"reports on {target.permalink}"

View File

@ -613,12 +613,12 @@ def submit_post(v:User, sub=None):
g.db.add(p)
g.db.flush()
execute_under_siege(v, p, p.body, 'submission')
execute_under_siege(v, p, p.body, 'post')
process_poll_options(v, p)
for text in {p.body, p.title, p.url}:
if execute_blackjack(v, p, text, 'submission'): break
if execute_blackjack(v, p, text, 'post'): break
vote = Vote(user_id=v.id,
vote_type=1,
@ -1046,10 +1046,10 @@ def edit_post(pid, v):
process_poll_options(v, p)
execute_under_siege(v, p, p.body, 'submission')
execute_under_siege(v, p, p.body, 'post')
for text in [p.body, p.title, p.url]:
if execute_blackjack(v, p, text, 'submission'): break
if execute_blackjack(v, p, text, 'post'): break
if len(body_html) > POST_BODY_HTML_LENGTH_LIMIT:
abort(400, "Submission body_html too long!")