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:
@@ -29,7 +29,7 @@ def call_material_from_elabid(elabid):
|
|||||||
try:
|
try:
|
||||||
material_data = APIHandler(apikey).get_entry_from_elabid(elabid, entryType="items")
|
material_data = APIHandler(apikey).get_entry_from_elabid(elabid, entryType="items")
|
||||||
# TO-DO: correct this typo on elabftw: Subtrate → Substrate.
|
# 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.")
|
raise ValueError(f"The referenced resource (elabid = {elabid}) is not a material.")
|
||||||
material_object = Material(material_data)
|
material_object = Material(material_data)
|
||||||
except ConnectionError as e:
|
except ConnectionError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user