add configurable contact email for error pages
This commit is contained in:
parent
085571e58f
commit
70a8d4f06a
@ -48,7 +48,9 @@ class Config(object):
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_PAGE_STYLE = 'light'
|
|
||||||
|
|
||||||
TITLE_SUFFIX = 'incorporeal.org'
|
|
||||||
MEDIA_DIR = 'media'
|
MEDIA_DIR = 'media'
|
||||||
|
|
||||||
|
# customizations
|
||||||
|
DEFAULT_PAGE_STYLE = 'light'
|
||||||
|
TITLE_SUFFIX = 'incorporeal.org'
|
||||||
|
CONTACT_EMAIL = 'bss@incorporeal.org'
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<h1>NOT FOUND</h1>
|
<h1>NOT FOUND</h1>
|
||||||
<p>Sorry, <b><tt>{{ request.path }}</tt></b> does not seem to exist, at least not anymore.</p>
|
<p>Sorry, <b><tt>{{ request.path }}</tt></b> does not seem to exist, at least not anymore.</p>
|
||||||
<p>It's possible you followed a dead link on this site, in which case I would appreciate it if you could email me via:
|
<p>It's possible you followed a dead link on this site, in which case I would appreciate it if you could email me via:
|
||||||
bss @ <this domain> and I can take a look. I make an effort to symlink old content to its new location,
|
{{ config.CONTACT_EMAIL }} and I can take a look. I make an effort to symlink old content to its new location,
|
||||||
so old links and URLs should, generally speaking, work.</p>
|
so old links and URLs should, generally speaking, work.</p>
|
||||||
<p>Otherwise, I suggest you go <a href="/">to the index</a> and navigate your way (hopefully) to what
|
<p>Otherwise, I suggest you go <a href="/">to the index</a> and navigate your way (hopefully) to what
|
||||||
you're looking for.</p>
|
you're looking for.</p>
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>INTERNAL SERVER ERROR</h1>
|
<h1>INTERNAL SERVER ERROR</h1>
|
||||||
<p>Something bad happened! Please email me at bss @ <this domain> and tell me what happened.</p>
|
<p>Something bad happened! Please email me at {{ config.CONTACT_EMAIL }} and tell me what happened.</p>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -14,6 +14,8 @@ def test_page_that_doesnt_exist(client):
|
|||||||
response = client.get('/ohuesthaoeusth')
|
response = client.get('/ohuesthaoeusth')
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
assert b'<b><tt>/ohuesthaoeusth</tt></b> does not seem to exist' in response.data
|
assert b'<b><tt>/ohuesthaoeusth</tt></b> does not seem to exist' in response.data
|
||||||
|
# test the contact email config
|
||||||
|
assert b'bss@incorporeal.org' in response.data
|
||||||
|
|
||||||
|
|
||||||
def test_files_outside_pages_do_not_get_served(client):
|
def test_files_outside_pages_do_not_get_served(client):
|
||||||
@ -28,6 +30,8 @@ def test_internal_server_error_serves_error_page(client):
|
|||||||
response = client.get('/actually-a-png')
|
response = client.get('/actually-a-png')
|
||||||
assert response.status_code == 500
|
assert response.status_code == 500
|
||||||
assert b'INTERNAL SERVER ERROR' in response.data
|
assert b'INTERNAL SERVER ERROR' in response.data
|
||||||
|
# test the contact email config
|
||||||
|
assert b'bss@incorporeal.org' in response.data
|
||||||
|
|
||||||
|
|
||||||
def test_weird_paths_do_not_get_served(client):
|
def test_weird_paths_do_not_get_served(client):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user