Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/profile', methods=["GET", "POST"])
- @login_required
- def profile():
- if request.method == "POST":
- query = """
- UPDATE user
- SET first_name=:first_name, last_name=:last_name, birth_date=:birth_date
- WHERE username=:username;
- """
- params = {
- 'first_name': request.form['first_name'],
- 'last_name': request.form['last_name'],
- 'birth_date': request.form['birth_date'],
- 'username': request.form['username']
- }
- g.db.execute(query, params)
- g.db.commit()
- flash("Your profile was correctly updated")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement