Commit cc0987c8 authored by Daniel Klaffenbach's avatar Daniel Klaffenbach 🐍

add 403/404 handlers

parent a3ee2a95
Pipeline #20957 passed with stage
in 35 seconds
......@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-28 09:47+0200\n"
"POT-Creation-Date: 2018-10-19 15:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -13,12 +13,49 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forms/__init__.py:56 forms/__init__.py:96
#: forms/__init__.py:60 forms/__init__.py:100
msgid "Submit"
msgstr "Absenden"
#: forms/__init__.py:91
#: forms/__init__.py:95
msgid "Language"
msgstr "Sprache"
#: templates/admin/base_site.html:8
msgid "Django site admin"
msgstr ""
#: templates/admin/base_site.html:11
msgid "Django administration"
msgstr ""
#: templates/tuc2014/403.html:6
msgid "Error 403: Access denied"
msgstr "Fehler 403: Zugriff nicht erlaubt"
#: templates/tuc2014/403.html:9
msgid ""
"The author of this web site has restricted the access. That's why you are "
"not allowed to use this web page."
msgstr ""
"Der Autor dieses Webangebots hat den Zugriff eingeschränkt. Danach sind Sie "
"nicht berechtigt, diese Webseite zu nutzen."
#: templates/tuc2014/403.html:12
msgid "If you think you should have access, please contact the webmaster."
msgstr ""
"Wenn Sie glauben, dass Sie berechtigt sein sollten, informieren Sie bitte "
"den Webmaster."
#: templates/tuc2014/404.html:16
msgid "Error 404: Web page not found"
msgstr "Fehler 404: Webseite nicht gefunden"
#: templates/tuc2014/404.html:19
msgid ""
"The website you have requested does not exist. If you have reached this "
"website through a link, please inform the webmaster about the broken link."
msgstr ""
"Die von Ihnen aufgerufene Webseite existiert nicht. Wenn Sie diese Webseite "
"über einen Link erreicht haben, informieren Sie bitte den Webmaster über den "
"defekten Link."
{% extends "tuc2014/base.html" %}
{% load i18n %}
{% block content %}
<h1>{% trans "Error 403: Access denied" %}</h1>
<p>
{% trans "The author of this web site has restricted the access. That's why you are not allowed to use this web page." %}
</p>
<p>
{% trans "If you think you should have access, please contact the webmaster." %}
</p>
{% endblock %}
{% extends "tuc2014/base.html" %}
{% load i18n %}
{% block content %}
<div class="row hidden-print">
<div class="col-xs-12">
<div class="tucal-aspectratiobox tucal-aspectratio15box">
<figure class="tucal-aspectratioboxcontent imgtitle" title="">
<img src="https://www.tu-chemnitz.de/haystack2.jpg" alt="">
</figure>
</div>
</div>
</div>
<h1>{% trans "Error 404: Web page not found" %}</h1>
<p>
{% blocktrans %}The website you have requested does not exist. If you have reached this website through a link, please inform the webmaster about the broken link.{% endblocktrans %}
</p>
{% endblock %}
......@@ -15,3 +15,11 @@ def change_language(request, **kwargs):
cur_language = translation.get_language()
form = ChangeLanguageForm(referer, initial={'language': cur_language})
return render(request, 'tuc2014/change_language.html', {'form': form, 'current': cur_language})
def handle_403(request, **kwargs):
return render(request, 'tuc2014/403.html', status=403)
def handle_404(request, **kwargs):
return render(request, 'tuc2014/404.html', status=404)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment