Have all error pages be rendered by Angular
Fixes #2198 Fixes https://www.pivotaltracker.com/story/show/135724483
This commit is contained in:
parent
0aa6e6cd58
commit
c06bba38de
13 changed files with 78 additions and 116 deletions
|
@ -67,7 +67,7 @@ def internal_error_display():
|
|||
@web.errorhandler(404)
|
||||
@web.route('/404', methods=['GET'])
|
||||
def not_found_error_display(e = None):
|
||||
resp = index('', error_code=404)
|
||||
resp = index('', error_code=404, error_info=dict(reason='notfound'))
|
||||
resp.status_code = 404
|
||||
return resp
|
||||
|
||||
|
@ -275,12 +275,6 @@ def dbrevision_health():
|
|||
return response
|
||||
|
||||
|
||||
@web.route('/disclaimer', methods=['GET'])
|
||||
@no_cache
|
||||
def disclaimer():
|
||||
return render_page_template_with_routedata('disclaimer.html')
|
||||
|
||||
|
||||
@web.route('/robots.txt', methods=['GET'])
|
||||
def robots():
|
||||
robots_txt = make_response(render_template('robots.txt', baseurl=get_app_url()))
|
||||
|
@ -367,7 +361,7 @@ def confirm_repo_email():
|
|||
try:
|
||||
record = model.repository.confirm_email_authorization_for_repo(code)
|
||||
except model.DataModelException as ex:
|
||||
return render_page_template_with_routedata('confirmerror.html', error_message=ex.message)
|
||||
return index('', error_info=dict(reason='confirmerror', error_message=ex.message))
|
||||
|
||||
message = """
|
||||
Your E-mail address has been authorized to receive notifications for repository
|
||||
|
@ -390,7 +384,7 @@ def confirm_email():
|
|||
try:
|
||||
user, new_email, old_email = model.user.confirm_user_email(code)
|
||||
except model.DataModelException as ex:
|
||||
return render_page_template_with_routedata('confirmerror.html', error_message=ex.message)
|
||||
return index('', error_info=dict(reason='confirmerror', error_message=ex.message))
|
||||
|
||||
if new_email:
|
||||
send_email_changed(user.username, old_email, new_email)
|
||||
|
@ -706,6 +700,7 @@ def redirect_to_repository(namespace_name, repo_name, tag_name):
|
|||
# - If the repository does exist (no access), 403
|
||||
# > If the user is not a member of the namespace: 403
|
||||
error_info = {
|
||||
'reason': 'notfound',
|
||||
'for_repo': True,
|
||||
'namespace_exists': namespace_exists,
|
||||
'namespace': namespace_name,
|
||||
|
|
Reference in a new issue