adds non-req. attr. "description" to class Target

This commit is contained in:
2026-02-12 23:53:21 +01:00
parent da42de5466
commit 43cfd788f3

View File

@@ -157,6 +157,8 @@ class Target(Material):
self.manufacturer = self.extra["Supplier"]["value"] self.manufacturer = self.extra["Supplier"]["value"]
except KeyError as k: except KeyError as k:
raise KeyError(f"The provided dictionary lacks a \"{k}\" key - which is specific for PLD targets. Check the {self.name} target entry on eLabFTW and make sure you used the correct Resource template.") raise KeyError(f"The provided dictionary lacks a \"{k}\" key - which is specific for PLD targets. Check the {self.name} target entry on eLabFTW and make sure you used the correct Resource template.")
# Non-required attributes:
self.description = material_data.get("body") or ""