Skip to content

Commit

Permalink
fix(jexl): always add root info
Browse files Browse the repository at this point in the history
info.case.root should always be defined - when we're in the root case,
it just resolves to the same value as info.case. This matches the way it
is already implemented in ember-caluma.
  • Loading branch information
czosel committed Jul 17, 2024
1 parent cb1d3d3 commit 7b154f8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions caluma/caluma_form/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,14 @@ def case(self):
self._case = None
return self._case

if hasattr(case, "parent_work_item"):
root = case.parent_work_item.case.family
root_info = {
"form": root.document.form.slug,
"workflow": root.workflow.slug,
}
else:
root_info = None

root = case.family
self._case = {
"form": case.document.form.slug,
"workflow": case.workflow.slug,
"root": root_info,
"root": {
"form": root.document.form.slug,
"workflow": root.workflow.slug,
},
}
return self._case

Expand Down

0 comments on commit 7b154f8

Please sign in to comment.