From 01bf373cff0032a63a65e011a7abc3ce84427c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 13 Dec 2023 14:36:47 +0100 Subject: [PATCH] tests: undefined variables will cause exception in debug mode --- web/b3desk/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/b3desk/__init__.py b/web/b3desk/__init__.py index 69a5664f..92651155 100755 --- a/web/b3desk/__init__.py +++ b/web/b3desk/__init__.py @@ -21,6 +21,7 @@ from flask_migrate import Migrate from flask_wtf.csrf import CSRFError from flask_wtf.csrf import CSRFProtect +from jinja2 import StrictUndefined CRITICAL_VARS = ["OIDC_ISSUER", "OIDC_CLIENT_SECRET", "BIGBLUEBUTTON_SECRET"] @@ -88,6 +89,9 @@ def setup_jinja(app): from b3desk.session import has_user_session from b3desk.session import get_current_user + if app.debug or app.testing: + app.jinja_env.undefined = StrictUndefined + @app.context_processor def global_processor(): if has_user_session():