fix 500 error caused by shit code

remotes/1693045480750635534/spooky-22
Aevann1 2022-08-27 00:01:36 +02:00
parent 45d5f52388
commit e0255a0fa4
1 changed files with 9 additions and 8 deletions

View File

@ -861,18 +861,19 @@ def settings_title_change(v):
if v.flairchanged: abort(403)
new_name=request.values.get("title").strip()[:100].replace("𒐪","")
customtitleplain = request.values.get("title").strip().replace("𒐪","")[:100]
if new_name == v.customtitle: return render_template("settings_profile.html", v=v, error="You didn't change anything")
if customtitleplain == v.customtitleplain:
return render_template("settings_profile.html", v=v, error="You didn't change anything")
v.customtitleplain = new_name
customtitle = filter_emojis_only(censor_slurs(customtitleplain, None))
new_name = censor_slurs(new_name, None)
if len(customtitle) > 1000:
return render_template("settings_profile.html", v=v, error="Flair too long!")
v.customtitle = filter_emojis_only(new_name)
if len(v.customtitle) > 1000:
return render_template("settings_profile.html", v=v, error="Flair too long")
v.customtitleplain = customtitleplain
v.customtitle = customtitle
g.db.add(v)
return redirect("/settings/profile")