From 0625ff552606d4927427d10cb078069bf6278cdd Mon Sep 17 00:00:00 2001 From: Bryce Willey Date: Wed, 14 Jan 2026 09:30:47 -0600 Subject: [PATCH] Actually remove DAEmptys from interview dict Should have already happened in https://github.com/jhpyle/docassemble/pull/877, but that patch isn't working for some reason. Interviews will still error when trying to view the variables and values, but it shouldn't error when trying to send the info with `requests` now. --- docassemble/EFSPIntegration/efm_client.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docassemble/EFSPIntegration/efm_client.py b/docassemble/EFSPIntegration/efm_client.py index f1c913b..3d61928 100644 --- a/docassemble/EFSPIntegration/efm_client.py +++ b/docassemble/EFSPIntegration/efm_client.py @@ -14,6 +14,7 @@ Person, Individual, DAStore, + DAEmpty, DADateTime, as_datetime, reconsider, @@ -93,6 +94,16 @@ def _give_data_url(bundle: ALDocumentBundle, key: str = "final") -> None: doc.page_count = doc_pdf.num_pages() +def _remove_all_da_emptys(json_val): + if isinstance(json_val, DAEmpty): + return None + if isinstance(json_val, list): + return [_remove_all_da_emptys(v) for v in json_val] + if isinstance(json_val, dict): + return {k: _remove_all_da_emptys(v) for k, v in json_val.items()} + return json_val + + def _get_all_vars(bundle: ALDocumentBundle, key: str = "final") -> Dict: """Strips out some extra big variables that we don't need to serialize and send across the network""" _give_data_url(bundle, key=key) @@ -132,6 +143,8 @@ def _get_all_vars(bundle: ALDocumentBundle, key: str = "final") -> Dict: for var in vars_to_pop: all_vars_dict.pop(var, None) + all_vars_dict = _remove_all_da_emptys(all_vars_dict) + for doc in all_vars_dict.get("al_court_bundle", {}).get("elements", []): doc.pop("optional_service_options", None) doc.pop("document_type_options", None)