disallow 18+ emoji with the emoji award

pull/211/head
Aevann 2023-10-04 16:11:20 +03:00
parent beef101ca8
commit bc8f5ff6a1
1 changed files with 2 additions and 0 deletions

View File

@ -560,6 +560,8 @@ def award_thing(v, thing_type, id):
emoji = g.db.query(Emoji).filter_by(name=award.note).one_or_none()
if not emoji:
abort(404, f'an Emoji with the name "{award.note}" was not found!')
if emoji.over_18:
abort(404, "You can't use 18+ emojis for this award!")
elif IS_HOMOWEEN():
if kind == "spider":
if author.spider: author.spider += 86400