From 1960b14d9d46e64681005dad0b080021dfa97f51 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch <p.jentsch@uni-bielefeld.de> Date: Wed, 11 Sep 2019 09:47:26 +0200 Subject: [PATCH] Re- rename edit_profile to settings --- app/auth/views.py | 12 ++++++------ .../auth/{edit_profile.html.j2 => settings.html.j2} | 0 app/templates/base.html.j2 | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) rename app/templates/auth/{edit_profile.html.j2 => settings.html.j2} (100%) diff --git a/app/auth/views.py b/app/auth/views.py index 69d3570f..acf12369 100644 --- a/app/auth/views.py +++ b/app/auth/views.py @@ -131,9 +131,9 @@ def password_reset(token): title='Password Reset') -@auth.route('/edit_profile', methods=['GET', 'POST']) +@auth.route('/settings', methods=['GET', 'POST']) @login_required -def edit_profile(): +def settings(): """ View where loged in User can change own User information like Password etc. """ @@ -144,7 +144,7 @@ def edit_profile(): db.session.add(current_user) db.session.commit() flash('Your password has been updated.') - return redirect(url_for('auth.edit_profile')) + return redirect(url_for('auth.settings')) else: flash('Invalid password.') change_profile_form = EditProfileForm(user=current_user) @@ -155,14 +155,14 @@ def edit_profile(): flash('Your email has been updated.') change_profile_form.email.data = current_user.email return render_template( - 'auth/edit_profile.html.j2', + 'auth/settings.html.j2', change_password_form=change_password_form, change_profile_form=change_profile_form, - title='Edit Profile' + title='Settings' ) -@auth.route('/edit_profile/delete_self/<int:user_id>', methods=['GET', 'POST']) +@auth.route('/settings/delete_self/<int:user_id>', methods=['GET', 'POST']) @login_required def delete_self(user_id): selected_user = User.query.filter_by(id=user_id).first() diff --git a/app/templates/auth/edit_profile.html.j2 b/app/templates/auth/settings.html.j2 similarity index 100% rename from app/templates/auth/edit_profile.html.j2 rename to app/templates/auth/settings.html.j2 diff --git a/app/templates/base.html.j2 b/app/templates/base.html.j2 index 9d0194b0..e01f7924 100644 --- a/app/templates/base.html.j2 +++ b/app/templates/base.html.j2 @@ -72,7 +72,7 @@ </div> <ul id="nav-account-dropdown" class="dropdown-content"> {% if current_user.is_authenticated %} - <li><a href="{{ url_for('auth.edit_profile') }}"><i class="material-icons">settings</i>Settings</a></li> + <li><a href="{{ url_for('auth.settings') }}"><i class="material-icons">settings</i>Settings</a></li> <li><a href="{{ url_for('auth.logout') }}"><i class="material-icons">power_settings_new</i>Log out</a></li> {% else %} <li><a href="{{ url_for('auth.login') }}"><i class="material-icons">person</i>Log in</a></li> @@ -116,7 +116,7 @@ <li><div class="divider"></div></li> <li><a class="subheader">Account</a></li> {% if current_user.is_authenticated %} - <li><a href="{{ url_for('auth.edit_profile') }}"><i class="material-icons">settings</i>Settings</a></li> + <li><a href="{{ url_for('auth.settings') }}"><i class="material-icons">settings</i>Settings</a></li> <li><a href="{{ url_for('auth.logout') }}"><i class="material-icons">power_settings_new</i>Log out</a></li> {% else %} <li><a href="{{ url_for('auth.login') }}"><i class="material-icons">person</i>Log in</a></li> -- GitLab