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 @@