From: Karl O. Pinc Date: Tue, 8 Oct 2024 16:57:49 +0000 (-0500) Subject: Make the "locals" dict always available for local template variables X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=eee51d17656890a24957ce53f6eaf57a8c510f62;p=pgwui_core Make the "locals" dict always available for local template variables --- diff --git a/src/pgwui_core/forms.py b/src/pgwui_core/forms.py index b7919ec..204e7d8 100644 --- a/src/pgwui_core/forms.py +++ b/src/pgwui_core/forms.py @@ -242,8 +242,11 @@ class LoadedForm(collections.abc.MutableMapping): Input: response Dict of results from connection execution errors List of errors from connection execution + locals Dict used by mako for "local variables" in templates + https://docs.makotemplates.org/en/latest/runtime.html#context-variables ''' response['errors'] = errors + response['locals'] = {} # Template uses this for local vars return response