diff options
-rw-r--r-- | core/TESTS/test_caves.py | 2 | ||||
-rw-r--r-- | core/views/expo.py | 4 | ||||
-rw-r--r-- | templates/pagenotfound.html | 30 |
3 files changed, 20 insertions, 16 deletions
diff --git a/core/TESTS/test_caves.py b/core/TESTS/test_caves.py index e80d5b4..437648a 100644 --- a/core/TESTS/test_caves.py +++ b/core/TESTS/test_caves.py @@ -79,6 +79,8 @@ class FixturePageTests(TestCase): """ # The fixtures have a password hash which is compatible with plain-text password 'secretword' + # The hash CHANGES whenever Django upgrades the encryption key length. Better to create the test uses + # algorithmically and not via a fixture. fixtures = ["auth_users", "expo_caves", "expo_exped"] ph = r"and leads in 800m of tortuous going to" diff --git a/core/views/expo.py b/core/views/expo.py index c8d9482..fadc6ed 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -57,7 +57,9 @@ def expofiles_redirect(request, filepath): return redirect(urljoin("http://expo.survex.com/expofiles/", filepath)) def spider(request, _): - return redirect("/?#") # so that suffixes applied by spider are no longer part of the url + # urls ending in "_edit_edit" + return render(request, "pagenotfound.html", {"path": path}, status=404) + # return redirect("/?#") # so that suffixes applied by spider are no longer part of the url def map(request): """Serves unadorned the expoweb/map/slippy/map.html file""" diff --git a/templates/pagenotfound.html b/templates/pagenotfound.html index 49132f0..913c092 100644 --- a/templates/pagenotfound.html +++ b/templates/pagenotfound.html @@ -19,28 +19,28 @@ div#editLinks a{ } </style> {% endblock %} -{% block title %}Page not found {{ path }}{% endblock %} +{% block title %}Page not found '{{ path }}'{% endblock %} {% block body %} -<h1>Page not found {{ path }}</h1> +<h1>Page not found '{{ path }}'</h1> - <div id="editLinks"> {% block loginInfo %} - <a href="/">Home</a> | - <a id="cuccLink" href="http://camcaving.uk/">CUCC</a> | - <a id="expoWebsiteLink" href="http://expo.survex.com">expo.survex</a> | - {% if user.username %}User:{{ user.username }} - {% if user.person %}(<a href="{{ user.person.get_absolute_url }}">{{ user.person }}</a>){% endif %} - | <a <a href='/accounts/logout/'>Log out</a> {% else %} <a href='/accounts/login/'>Log in</a> {% endif %} - </div> - {% endblock%} +<div > +{% if user.username %}user: '{{ user.username }}' + | <a <a href='/accounts/logout/'>Log out</a> +{% else %} <a href='/accounts/login/'>Log in</a> +{% endif %} +</div> + <p>Probably a mistake. This page does not exist. - -Did you mistype a URL? -If you do want to create this page click <a href="{%url "editexpopage" path %} ">this link</a>. +Did you mistype the URL '<b>{{ path }}</b>' ? +{% if user.username %} + <p> + If you do want to create this page, click <a href="{%url "editexpopage" path %} ">this link</a>. +{% endif %} <p> - + <p> <p>Did you get lost ?</p> <img align=center src="/handbook/i/204-area.png"> |