mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44: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")
|
||||
elif request.method == "POST":
|
||||
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:
|
||||
user.password = bcrypt.hashpw(bytes(new_password, encoding="utf8"), bcrypt.gensalt())
|
||||
user.fiorygi += 1
|
||||
fl_g.session.commit()
|
||||
return redirect(url_for("page_main"))
|
||||
abort(403)
|
||||
user.password = bcrypt.hashpw(bytes(new_password, encoding="utf8"), bcrypt.gensalt())
|
||||
fl_g.session.commit()
|
||||
return redirect(url_for("page_main"))
|
||||
|
||||
|
||||
@app.route("/editprofile", methods=["GET", "POST"])
|
||||
|
|
Loading…
Reference in a new issue