From d85918d2efce30a1d9898b03c982fa545b56db37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 18 Nov 2013 14:27:55 +0100 Subject: [PATCH] Smarter key-not-found page --- wtem/templates/wtem/key_not_found.html | 10 ++++++++++ wtem/views.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 wtem/templates/wtem/key_not_found.html diff --git a/wtem/templates/wtem/key_not_found.html b/wtem/templates/wtem/key_not_found.html new file mode 100644 index 0000000..9523295 --- /dev/null +++ b/wtem/templates/wtem/key_not_found.html @@ -0,0 +1,10 @@ +{% extends 'base_super.html' %} + +{% block body %} +

Wielki Turniej Edukacji Medialnej

+

Niepoprawny link

+ +

Podany adres jest niepoprawny. Żeby móc rozwiązywać zadania musisz przejść pod dokłanie ten sam adres co +podany w wysłanej do Ciebie wiadomości e-mail.

+ +{% endblock %} \ No newline at end of file diff --git a/wtem/views.py b/wtem/views.py index 278ddc3..546ec5b 100644 --- a/wtem/views.py +++ b/wtem/views.py @@ -35,7 +35,7 @@ def form_during(request, key): if settings.DEBUG and key == DEBUG_KEY: submission = Submission.create(first_name = 'Debug', last_name = 'Debug', email = 'debug@debug.com', key = DEBUG_KEY) else: - raise Http404 + return render(request, 'wtem/key_not_found.html') if request.method == 'GET': return render(request, 'wtem/main.html', dict(exercises = exercises, end_time = submission.end_time)) elif request.method == 'POST': -- 2.20.1