This commit is contained in:
Aevann1 2022-02-26 21:56:58 +02:00
parent 7159b8d175
commit bc401701f5
5 changed files with 12 additions and 11 deletions

View file

@ -14,8 +14,6 @@ from files.helpers.discord import add_role
from shutil import copyfile
import requests
valid_password_regex = re.compile("^.{8,100}$", flags=re.A)
YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip()
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
@ -534,7 +532,7 @@ def settings_security_post(v):
if request.values.get("new_password") != request.values.get("cnf_password"):
return render_template("settings_security.html", v=v, error="Passwords do not match.")
if not re.fullmatch(valid_password_regex, request.values.get("new_password"), flags=re.A):
if not valid_password_regex.fullmatch(request.values.get("new_password"), flags=re.A):
return render_template("settings_security.html", v=v, error="Password must be between 8 and 100 characters.")
if not v.verifyPass(request.values.get("old_password")):
@ -861,7 +859,7 @@ def settings_name_change(v):
v=v,
error="You didn't change anything")
if not re.fullmatch(valid_username_regex, new_name, flags=re.A):
if not valid_username_regex.fullmatch(new_name, flags=re.A):
return render_template("settings_profile.html",
v=v,
error="This isn't a valid username.")