forked from rDrama/rDrama
1
0
Fork 0

fix 500 and populate page on error

master
justcool393 2022-10-19 18:35:58 -05:00
parent 9627c6db01
commit ffdf810aa9
1 changed files with 3 additions and 4 deletions

View File

@ -350,12 +350,12 @@ if SITE not in ('pcmemes.net', 'watchpeopledie.tv'):
tags = request.values.get('tags').lower().strip()
def error(error):
return render_template("update_assets.html", v=v, error=error, type="Marsey")
return render_template("update_assets.html", v=v, error=error, name=name, tags=tags, type="Marsey")
if not marsey_regex.fullmatch(name):
return error("Invalid name!")
existing = g.db.query(Marsey.name).filter_by(name=name).one_or_none()
existing = g.db.query(Marsey).filter_by(name=name).one_or_none()
if not existing:
return error("A marsey with this name doesn't exist!")
@ -384,8 +384,7 @@ if SITE not in ('pcmemes.net', 'watchpeopledie.tv'):
if tags and existing.tags != tags:
existing.tags = tags
g.db.add(existing)
if not file and not tags:
elif not file:
return error("You need to update this marsey!")
ma = ModAction(