fixes small residual from copy-paste in call_material_from_elabid

the fix changes "sample_data" - which was residual from copy-pasting the
call_entrypoint... function and therefore undefined - with
"material_data" which is very well defined in the previous line
This commit is contained in:
2026-02-12 15:09:18 +01:00
parent fd4c3b718a
commit 5a605038df

View File

@@ -29,7 +29,7 @@ def call_material_from_elabid(elabid):
try:
material_data = APIHandler(apikey).get_entry_from_elabid(elabid, entryType="items")
# TO-DO: correct this typo on elabftw: Subtrate → Substrate.
if not sample_data.get("category_title") in ["PLD Target", "Substrate batch", "Subtrate batch"]:
if not material_data.get("category_title") in ["PLD Target", "Substrate batch", "Subtrate batch"]:
raise ValueError(f"The referenced resource (elabid = {elabid}) is not a material.")
material_object = Material(material_data)
except ConnectionError as e: