forked from MarseyWorld/MarseyWorld
Fix posting/commenting from API.
The rework to v.client meant that `is_bot` on Submission and Comment would attempt to be populated with a ClientAuth object when submitted by a bot other than Snappy or bbbb. SQLAlchemy requires an actual boolean, not just a truthy value.master
parent
ed2b6938ba
commit
616e15ebb9
|
@ -255,7 +255,9 @@ def comment(v):
|
||||||
if parent.author.any_block_exists(v) and v.admin_level < PERMS['POST_COMMENT_MODERATION']:
|
if parent.author.any_block_exists(v) and v.admin_level < PERMS['POST_COMMENT_MODERATION']:
|
||||||
abort(403, "You can't reply to users who have blocked you or users that you have blocked.")
|
abort(403, "You can't reply to users who have blocked you or users that you have blocked.")
|
||||||
|
|
||||||
is_bot = v.id != BBBB_ID and v.client or (SITE == 'pcmemes.net' and v.id == SNAPPY_ID)
|
is_bot = (v.client is not None
|
||||||
|
and v.id != BBBB_ID
|
||||||
|
or (SITE == 'pcmemes.net' and v.id == SNAPPY_ID))
|
||||||
|
|
||||||
execute_antispam_comment_check(body, v)
|
execute_antispam_comment_check(body, v)
|
||||||
|
|
||||||
|
|
|
@ -877,8 +877,6 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
if embed and len(embed) > 1500: embed = None
|
if embed and len(embed) > 1500: embed = None
|
||||||
|
|
||||||
is_bot = v.id != BBBB_ID and v.client or (SITE == 'pcmemes.net' and v.id == SNAPPY_ID)
|
|
||||||
|
|
||||||
if request.values.get("ghost") and v.coins >= 100:
|
if request.values.get("ghost") and v.coins >= 100:
|
||||||
v.charge_account('coins', 100)
|
v.charge_account('coins', 100)
|
||||||
ghost = True
|
ghost = True
|
||||||
|
@ -894,7 +892,7 @@ def submit_post(v, sub=None):
|
||||||
over_18=bool(request.values.get("over_18","")),
|
over_18=bool(request.values.get("over_18","")),
|
||||||
new=bool(request.values.get("new","")),
|
new=bool(request.values.get("new","")),
|
||||||
app_id=v.client.application.id if v.client else None,
|
app_id=v.client.application.id if v.client else None,
|
||||||
is_bot = is_bot,
|
is_bot=(v.client is not None),
|
||||||
url=url,
|
url=url,
|
||||||
body=body,
|
body=body,
|
||||||
body_html=body_html,
|
body_html=body_html,
|
||||||
|
|
Loading…
Reference in New Issue