def postsave(user): solved = request.form.getlist("solved") password = request.form.get("password", None) pseudo = request.form.get("pseudo", None) pic = request.form.get("pic", None) if password and password != "": newpass = bcrypt.hashpw(str(password), bcrypt.gensalt(7)) sql.updatePassword(user.login, newpass) if pseudo is not None: sql.updatePseudo(user.login, pseudo) sql.updateSolved(user.login, solved) sql.updatePicture(user.login, pic) flash("User updated !", "success")
def postsave(user): password = request.form.get("password", None) pseudo = request.form.get("pseudo", None) chkck = request.form.get("chkbx", None) is not None pic = request.form.get("pic", None) if password and password != "": newpass = bcrypt.hashpw(str(password), bcrypt.gensalt(7)) sql.updatePassword(user.login, newpass) if pseudo and pseudo != "": sql.updatePseudo(user.login, pseudo) else: sql.updatePseudo(user.login, None) sql.updateHide(user.login, chkck) sql.updatePicture(user.login, pic)