From: Aleksander Łukasz Date: Mon, 18 Nov 2013 13:27:55 +0000 (+0100) Subject: Smarter key-not-found page X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/d85918d2efce30a1d9898b03c982fa545b56db37?ds=inline Smarter key-not-found page --- 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':