Skip to content

Commit

Permalink
Bug fixed, node variables cleanup properly
Browse files Browse the repository at this point in the history
  • Loading branch information
egalvis39 committed May 12, 2023
1 parent 1d48d17 commit be441d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions menuflow/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,5 @@ def node(
return

node_initialized.room = room
node_initialized.variables = self.flow_variables or {}
node_initialized.variables.update(room._variables)

return node_initialized
6 changes: 3 additions & 3 deletions menuflow/nodes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ def render_data(self, data: Dict | List | str) -> Dict | List | str:
self.log.exception(e)
return

self.variables.update(self.room._variables)
copy_variables = {**self.variables, **self.room._variables}

try:
data = loads(data_template.render(**self.variables))
data = loads(data_template.render(**copy_variables))
data = convert_to_bool(data)
return data
except JSONDecodeError:
data = data_template.render(**self.variables)
data = data_template.render(**copy_variables)
return convert_to_bool(data)
except KeyError:
data = loads(data_template.render())
Expand Down

0 comments on commit be441d6

Please sign in to comment.