From e6427389c6c1b073490cbee2cae03a76332a0947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 13 Dec 2021 20:20:25 +0100 Subject: [PATCH] =?UTF-8?q?Warning,=20kdy=C5=BE=20prom=C4=9Bnn=C3=A1=20v?= =?UTF-8?q?=20template=20neexistuje.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mamweb/settings_common.py | 13 +++++++++++++ mamweb/templates/base.html | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index ce028bc2..5b7b257b 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -336,3 +336,16 @@ CISLO_IMG_DIR = os.path.join('cislo', 'img') # E-MAIL NOTIFICATIONS POSLI_MAILOVOU_NOTIFIKACI = False + + + +# Logování chyb +class InvalidTemplateVariable(str): + def __mod__(self, variable): + import logging + logger = logging.getLogger(__name__) + logger.warning("Proměnná '%s' neexistuje" % variable) + return '' +TEMPLATES[0]['OPTIONS']['string_if_invalid'] = InvalidTemplateVariable('%s') + + diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index 85cb9e12..c5c12271 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -6,7 +6,7 @@ {% block title %}{% block nadpis1a %}{% endblock %} – Korespondenční seminář M&M{% endblock title %} - {% render_block css %} +{# {% render_block css %}#} {% block custom_css %}{% endblock %}