mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-27 06:11:34 +00:00
Rename profile to account and enable password change.
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user