diff --git a/scripts/__pycache__/docx_ops_lib.cpython-311.pyc b/scripts/__pycache__/docx_ops_lib.cpython-311.pyc index 36b1b19..dca4836 100644 Binary files a/scripts/__pycache__/docx_ops_lib.cpython-311.pyc and b/scripts/__pycache__/docx_ops_lib.cpython-311.pyc differ diff --git a/scripts/docx_ops_lib.py b/scripts/docx_ops_lib.py index c0495ea..502627c 100644 --- a/scripts/docx_ops_lib.py +++ b/scripts/docx_ops_lib.py @@ -174,7 +174,10 @@ def resolve_generation_options(payload: dict[str, Any]) -> dict[str, Any]: def _get_xml_element(target: Any) -> Any | None: - return getattr(target, "_element", None) or getattr(target, "element", None) + element = getattr(target, "_element", None) + if element is not None: + return element + return getattr(target, "element", None) def _set_font_family(target: Any, font_name: str) -> None: @@ -1265,6 +1268,7 @@ def apply_patch_document(patch_data: dict[str, Any]) -> dict[str, Any]: "in_place": in_place, "docx_style_profile": options["docx_style_profile"], "numbering_mode": options["numbering_mode"], + "document_kind": options["document_kind"], "template_docx": str(Path(options["template_docx"]).resolve()) if options["template_docx"] else None, "operation_count": len(operations), "operations": operation_reports,