mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 04:00:01 +00:00
Weed out last few hardcoded urls
This commit is contained in:
parent
e728ca1818
commit
7a04d64f9c
|
@ -49,7 +49,7 @@ def create_app(config):
|
|||
app.logger.error(exception)
|
||||
flask.flash(flask.Markup(
|
||||
'<strong>An error occurred!</strong> Debug information has been logged.'), 'danger')
|
||||
return flask.redirect('/')
|
||||
return flask.redirect(flask.url_for('main.home'))
|
||||
|
||||
# Get git commit hash
|
||||
app.config['COMMIT_HASH'] = None
|
||||
|
|
|
@ -93,7 +93,8 @@ def register():
|
|||
@bp.route('/profile', methods=['GET', 'POST'])
|
||||
def profile():
|
||||
if not flask.g.user:
|
||||
return flask.redirect('/') # so we dont get stuck in infinite loop when signing out
|
||||
# so we dont get stuck in infinite loop when signing out
|
||||
return flask.redirect(flask.url_for('main.home'))
|
||||
|
||||
form = forms.ProfileForm(flask.request.form)
|
||||
|
||||
|
@ -130,11 +131,13 @@ def profile():
|
|||
|
||||
|
||||
def redirect_url():
|
||||
home_url = flask.url_for('main.home')
|
||||
|
||||
url = flask.request.args.get('next') or \
|
||||
flask.request.referrer or \
|
||||
'/'
|
||||
home_url
|
||||
if url == flask.request.url:
|
||||
return '/'
|
||||
return home_url
|
||||
return url
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue