mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Fix change password bug
This commit is contained in:
parent
ab0fa243f5
commit
e75e087857
1 changed files with 4 additions and 5 deletions
|
@ -182,13 +182,12 @@ def page_password():
|
||||||
return render_template("password.html")
|
return render_template("password.html")
|
||||||
elif request.method == "POST":
|
elif request.method == "POST":
|
||||||
new_password = request.form.get("new", "")
|
new_password = request.form.get("new", "")
|
||||||
user = fl_g.session.query(db.Royal).filter_by(id=fl_g.user_id).one()
|
user = fl_g.session.query(db.Royal).filter_by(id=fl_g.user.id).one()
|
||||||
if user.password is None:
|
if user.password is None:
|
||||||
user.password = bcrypt.hashpw(bytes(new_password, encoding="utf8"), bcrypt.gensalt())
|
|
||||||
user.fiorygi += 1
|
user.fiorygi += 1
|
||||||
|
user.password = bcrypt.hashpw(bytes(new_password, encoding="utf8"), bcrypt.gensalt())
|
||||||
fl_g.session.commit()
|
fl_g.session.commit()
|
||||||
return redirect(url_for("page_main"))
|
return redirect(url_for("page_main"))
|
||||||
abort(403)
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/editprofile", methods=["GET", "POST"])
|
@app.route("/editprofile", methods=["GET", "POST"])
|
||||||
|
|
Loading…
Reference in a new issue