Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using 'data' rather than 'data from code' for al_nav_sections #844

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docassemble/AssemblyLine/al_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -2244,8 +2244,12 @@ def send_email(
return send_email(
to=to,
template=template,
attachments=set(
self.as_editable_list(key=key) + self.as_pdf_list(key=key)
# Add both DOCX and PDF versions, but if it's not possible to be a DOCX don't add the PDF
# twice
attachments=list(
dict.fromkeys(
self.as_editable_list(key=key) + self.as_pdf_list(key=key)
)
),
**kwargs,
)
Expand Down
8 changes: 5 additions & 3 deletions docassemble/AssemblyLine/al_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ def get_visible_al_nav_items(

# For dictionaries at top level
item_copy = deepcopy(item)
if not item_copy.pop("hidden", False): # if not hidden
if not str(item_copy.pop("hidden", "False")).lower() == "true": # if not hidden
for key, val in item_copy.items():
if isinstance(val, list): # if value of a key is a list
new_sublist: List[Union[str, dict]] = []
Expand All @@ -2087,8 +2087,10 @@ def get_visible_al_nav_items(
if isinstance(subitem, str):
new_sublist.append(subitem)
# Add dictionaries if not hidden
elif isinstance(subitem, dict) and not subitem.pop(
"hidden", False
elif (
isinstance(subitem, dict)
and not str(subitem.pop("hidden", "False")).lower()
== "true"
):
new_sublist.append(subitem)
item_copy[key] = new_sublist
Expand Down
Loading