Browse Source

Warning, když proměnná v template neexistuje.

export_seznamu_prednasek
Jonas Havelka 3 years ago
parent
commit
e6427389c6
  1. 13
      mamweb/settings_common.py
  2. 2
      mamweb/templates/base.html

13
mamweb/settings_common.py

@ -336,3 +336,16 @@ CISLO_IMG_DIR = os.path.join('cislo', 'img')
# E-MAIL NOTIFICATIONS # E-MAIL NOTIFICATIONS
POSLI_MAILOVOU_NOTIFIKACI = False 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')

2
mamweb/templates/base.html

@ -6,7 +6,7 @@
<title>{% block title %}{% block nadpis1a %}{% endblock %} – Korespondenční seminář M&amp;M{% endblock title %}</title> <title>{% block title %}{% block nadpis1a %}{% endblock %} – Korespondenční seminář M&amp;M{% endblock title %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="{% static 'images/MATFYZ_MM_barevne.svg' %}" type="image/x-icon"> <link rel="shortcut icon" href="{% static 'images/MATFYZ_MM_barevne.svg' %}" type="image/x-icon">
{% render_block css %} {# {% render_block css %}#}
{% block custom_css %}{% endblock %} {% block custom_css %}{% endblock %}
<link href="{% static 'css/bootstrap-theme.css' %}" rel="stylesheet"> <link href="{% static 'css/bootstrap-theme.css' %}" rel="stylesheet">
<link href="{% static 'css/bootstrap.css' %}" rel="stylesheet"> <link href="{% static 'css/bootstrap.css' %}" rel="stylesheet">

Loading…
Cancel
Save