forked from MarseyWorld/MarseyWorld
flags
parent
2dc16548a4
commit
eb72792b44
|
@ -268,10 +268,10 @@ def sign_up_post(v):
|
||||||
"password") == request.values.get("password_confirm"):
|
"password") == request.values.get("password_confirm"):
|
||||||
return new_signup("Passwords did not match. Please try again.")
|
return new_signup("Passwords did not match. Please try again.")
|
||||||
|
|
||||||
if not valid_username_regex.fullmatch(username, flags=re.A):
|
if not valid_username_regex.fullmatch(username):
|
||||||
return new_signup("Invalid username")
|
return new_signup("Invalid username")
|
||||||
|
|
||||||
if not valid_password_regex.fullmatch(request.values.get("password"), flags=re.A):
|
if not valid_password_regex.fullmatch(request.values.get("password")):
|
||||||
return new_signup("Password must be between 8 and 100 characters.")
|
return new_signup("Password must be between 8 and 100 characters.")
|
||||||
|
|
||||||
email = request.values.get("email").strip().lower()
|
email = request.values.get("email").strip().lower()
|
||||||
|
|
|
@ -532,7 +532,7 @@ def settings_security_post(v):
|
||||||
if request.values.get("new_password") != request.values.get("cnf_password"):
|
if request.values.get("new_password") != request.values.get("cnf_password"):
|
||||||
return render_template("settings_security.html", v=v, error="Passwords do not match.")
|
return render_template("settings_security.html", v=v, error="Passwords do not match.")
|
||||||
|
|
||||||
if not valid_password_regex.fullmatch(request.values.get("new_password"), flags=re.A):
|
if not valid_password_regex.fullmatch(request.values.get("new_password")):
|
||||||
return render_template("settings_security.html", v=v, error="Password must be between 8 and 100 characters.")
|
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")):
|
if not v.verifyPass(request.values.get("old_password")):
|
||||||
|
@ -859,7 +859,7 @@ def settings_name_change(v):
|
||||||
v=v,
|
v=v,
|
||||||
error="You didn't change anything")
|
error="You didn't change anything")
|
||||||
|
|
||||||
if not valid_username_regex.fullmatch(new_name, flags=re.A):
|
if not valid_username_regex.fullmatch(new_name):
|
||||||
return render_template("settings_profile.html",
|
return render_template("settings_profile.html",
|
||||||
v=v,
|
v=v,
|
||||||
error="This isn't a valid username.")
|
error="This isn't a valid username.")
|
||||||
|
|
|
@ -273,7 +273,7 @@ def create_sub2(v):
|
||||||
if not name: abort(400)
|
if not name: abort(400)
|
||||||
name = name.strip().lower()
|
name = name.strip().lower()
|
||||||
|
|
||||||
if not valid_sub_regex.fullmatch(name, flags=re.A):
|
if not valid_sub_regex.fullmatch(name):
|
||||||
return render_template("sub/create_sub.html", v=v, error="Sub name not allowed."), 400
|
return render_template("sub/create_sub.html", v=v, error="Sub name not allowed."), 400
|
||||||
|
|
||||||
sub = g.db.query(Sub).filter_by(name=name).one_or_none()
|
sub = g.db.query(Sub).filter_by(name=name).one_or_none()
|
||||||
|
|
Loading…
Reference in New Issue