mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-04 13:41:38 -04:00
Merge pull request #973 from alphagov/remove-documentation
Remove documentation pages
This commit is contained in:
@@ -384,10 +384,14 @@ def register_errorhandlers(application):
|
||||
error.message
|
||||
))
|
||||
error_code = error.status_code
|
||||
if error_code not in [401, 404, 403, 500]:
|
||||
if error_code not in [401, 404, 403, 410, 500]:
|
||||
error_code = 500
|
||||
return _error_response(error_code)
|
||||
|
||||
@application.errorhandler(410)
|
||||
def handle_gone(error):
|
||||
return _error_response(410)
|
||||
|
||||
@application.errorhandler(404)
|
||||
def handle_not_found(error):
|
||||
return _error_response(404)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import markdown
|
||||
import os
|
||||
from flask import (render_template, url_for, redirect, Markup, request)
|
||||
from flask import (render_template, url_for, redirect, Markup, request, abort)
|
||||
from app.main import main
|
||||
from app import convert_to_boolean
|
||||
from flask_login import login_required
|
||||
@@ -95,12 +95,4 @@ def email_template():
|
||||
|
||||
@main.route('/documentation')
|
||||
def documentation():
|
||||
curr_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
with open(os.path.join(curr_dir, '../../../docs/index.md'), encoding='utf-8') as source:
|
||||
return render_template(
|
||||
'views/documentation.html',
|
||||
body=Markup(markdown.markdown(
|
||||
source.read(),
|
||||
extensions=[GithubFlavoredMarkdownExtension()]
|
||||
))
|
||||
)
|
||||
abort(410)
|
||||
|
||||
14
app/templates/error/410.html
Normal file
14
app/templates/error/410.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% block page_title %}Page not found{% endblock %}
|
||||
{% block maincolumn_content %}
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">
|
||||
Page could not be found
|
||||
</h1>
|
||||
<p>
|
||||
Check you’ve entered the correct web address.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user