Rename profile to account and enable password change.

This commit is contained in:
Patrick Jentsch
2019-07-09 13:40:33 +02:00
parent de2aacc2de
commit 37765c755a
3 changed files with 11 additions and 8 deletions

View File

@@ -125,9 +125,9 @@ def password_reset(token):
title='Password Reset')
@auth.route('/profile', methods=['GET', 'POST'])
@auth.route('/account', methods=['GET', 'POST'])
@login_required
def profile():
def account():
form = ChangeProfileForm()
if form.validate_on_submit():
flash('It is just a test, nothing changed.')
@@ -138,8 +138,10 @@ def profile():
current_user.email = form.email.data
current_user.confirmed = False
db.session.add(current_user)
resend_confirmation()
if form.password.data:
current_user.password = form.password.data
db.session.commit()
resend_confirmation()
return redirect(url_for('auth.profile'))
return render_template('auth/profile.html.j2', form=form,
title='Profile')
return redirect(url_for('auth.account'))
return render_template('auth/account.html.j2', form=form,
title='Account')