Warning, když proměnná v template neexistuje.
This commit is contained in:
		
							parent
							
								
									628cefa7b8
								
							
						
					
					
						commit
						e6427389c6
					
				
					 2 changed files with 14 additions and 1 deletions
				
			
		|  | @ -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') | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ | |||
|     <title>{% block title %}{% block nadpis1a %}{% endblock %} – Korespondenční seminář M&M{% endblock title %}</title> | ||||
|     <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"> | ||||
|     {% render_block css %} | ||||
| {#    {% render_block css %}#} | ||||
|     {% block custom_css %}{% endblock %} | ||||
|     <link href="{% static 'css/bootstrap-theme.css' %}" rel="stylesheet"> | ||||
|     <link href="{% static 'css/bootstrap.css' %}" rel="stylesheet"> | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue