Fix user redirects to go to the correct URL

`/user` no longer works and returns a 404; we now need to redirect to the specific user page
This commit is contained in:
Joseph Schorr 2016-11-28 18:55:41 -05:00
parent 1c3012a538
commit 0e24f6b40a
2 changed files with 8 additions and 12 deletions

View file

@ -126,12 +126,6 @@ def organizations():
return index('')
@web.route('/user/')
@no_cache
def user():
return index('')
@web.route('/superuser/')
@no_cache
@route_show_if(features.SUPER_USERS)
@ -405,8 +399,10 @@ def confirm_email():
common_login(user)
if model.user.has_user_prompts(user):
return redirect(url_for('web.updateuser'))
elif new_email:
return redirect(url_for('web.user_view', path=user.username, tab='settings'))
else:
return redirect(url_for('web.user', tab='email') if new_email else url_for('web.index'))
return redirect(url_for('web.index'))
@web.route('/recovery', methods=['GET'])
@ -418,7 +414,7 @@ def confirm_recovery():
if user is not None:
common_login(user)
return redirect(url_for('web.user'))
return redirect(url_for('web.user_view', path=user.username, tab='settings', action='password'))
else:
message = 'Invalid recovery code: This code is invalid or may have already been used.'
return render_page_template_with_routedata('message.html', message=message)