Classify common template payloads consistently
This commit is contained in:
@@ -42362,9 +42362,20 @@ def metadata_object_templates(payload: dict[str, Any]) -> dict[str, Any]:
|
||||
)
|
||||
if direct.get("status") != "ok":
|
||||
return direct
|
||||
parts_result = metadata_object_parts(
|
||||
{
|
||||
"base_id": base_id, "guid": guid, "kind": "Template", "table": table,
|
||||
"include_text": bool(include_text), "include_tree": bool(include_tree),
|
||||
"include_storage": include_storage, "evidence_mode": evidence_mode,
|
||||
"timeout_seconds": timeout_seconds,
|
||||
}
|
||||
)
|
||||
classified_parts = parts_result.get("parts") if isinstance(parts_result.get("parts"), list) else []
|
||||
common_summary = public_template_summary(classified_parts, include_storage=include_storage) if classified_parts else {}
|
||||
templates = []
|
||||
for template_item in direct.get("templates") or []:
|
||||
item = dict(template_item)
|
||||
item.update(common_summary)
|
||||
item["name"] = item.get("name") or (object_card or {}).get("name")
|
||||
item["kind"] = "CommonTemplate"
|
||||
item["ref"] = (object_card or {}).get("ref") or object_selector_ref("CommonTemplate", str(item.get("name") or ""))
|
||||
|
||||
Reference in New Issue
Block a user