Skip to content

Commit 4b15147

Browse files
Release v0.2.155
Fixed twig rendering messages when there are errors in the rendered file
1 parent d1f563b commit 4b15147

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "tina4-python"
3-
version = "0.2.154"
3+
version = "0.2.155"
44
description = "Tina4Python - This is not another framework for Python"
55
authors = [
66
{name = "Andre van Zuydam",email = "andrevanzuydam@gmail.com"}

tina4_python/Template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from tina4_python.Debug import Debug
1616
from pathlib import Path
1717
from datetime import datetime, date
18-
from jinja2 import Environment, FileSystemLoader, Undefined
18+
from jinja2 import Environment, FileSystemLoader, Undefined, TemplateNotFound
1919
from tina4_python.Session import Session
2020
from random import random as RANDOM
2121
from typing import Dict, Any
@@ -150,7 +150,7 @@ def render_twig_template(template_or_file_name, data=None):
150150
if twig.get_template(template_or_file_name):
151151
template = twig.get_template(template_or_file_name)
152152
content = template.render(data)
153-
except:
153+
except TemplateNotFound:
154154
template = twig.from_string(template_or_file_name)
155155
content = template.render(data)
156156

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)