Skip to content

Commit

Permalink
tests: undefined variables will cause exception in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Dec 13, 2023
1 parent c9c717a commit 01bf373
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/b3desk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 01bf373

Please sign in to comment.