fix 500 error

master
Aevann 2024-08-28 14:51:18 +03:00
parent 37b0665095
commit c79178d640
1 changed files with 5 additions and 0 deletions

View File

@ -253,6 +253,11 @@ def approve_emoji(v, name):
if not new_name:
stop(400, "You need to include name!")
if new_name != emoji.name:
existing = g.db.query(Emoji.name).filter_by(name=new_name).one_or_none()
if existing:
stop(400, "Someone already submitted an emoji with this name!")
tags = delete_unnecessary_tags(tags, new_name)
new_kind = request.values.get('kind').strip()