fix: avoid error when material type is unknown

not sure if this is a unique situation in my dev environment or
what..but i keep encountering this in dev, so might as well add it.
better safe than sorry
This commit is contained in:
Lance Edgar 2026-03-10 10:52:35 -05:00
parent f48cf55963
commit 3bacb884dc

View file

@ -81,7 +81,9 @@ def render_quantity_object(quantity):
text = f"( {measure} ) {value} {unit}" text = f"( {measure} ) {value} {unit}"
if quantity["quantity_type_id"] == "material": if quantity["quantity_type_id"] == "material":
materials = ", ".join([mtype["name"] for mtype in quantity["material_types"]]) materials = ", ".join(
[mtype.get("name", "???") for mtype in quantity["material_types"]]
)
return f"{materials} {text}" return f"{materials} {text}"
return text return text