fix name bug with hats

master
justcool393 2022-10-20 09:14:18 -05:00
parent 5efb51ca57
commit d14eb65056
1 changed files with 3 additions and 1 deletions

View File

@ -166,7 +166,9 @@ if SITE not in ('pcmemes.net', 'watchpeopledie.tv'):
def remove_asset(cls, type_name:str, v:User, name:str) -> dict[str, str]: def remove_asset(cls, type_name:str, v:User, name:str) -> dict[str, str]:
if cls not in ASSET_TYPES: raise Exception("not a valid asset type") if cls not in ASSET_TYPES: raise Exception("not a valid asset type")
name = name.lower().strip() should_make_lower = cls == HatDef
if should_make_lower: name = name.lower()
name = name.strip()
if not name: if not name:
abort(400, f"You need to specify a {type_name}!") abort(400, f"You need to specify a {type_name}!")
asset = g.db.query(cls).filter_by(name=name).one_or_none() asset = g.db.query(cls).filter_by(name=name).one_or_none()