Skip to content

Commit d527621

Browse files
committed
Fixed permId getter
1 parent e348c82 commit d527621

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bam_masterdata/openbis/get_entities.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def _assign_properties(self, entity_name: str, formatted_dict: dict) -> None:
3131
for entry in assignments_dict:
3232
# ! This has changed and now permId does not exist on the property assignments!!
3333
property_perm_id = (
34-
entry.get("permId", {}).get("propertyTypeId", {}).get("permId")
34+
self.openbis.get_property_type(entry.get("code", {})).permId
3535
)
36+
print(property_perm_id)
3637
if property_perm_id:
3738
# Include the desired property fields
3839
properties[property_perm_id] = {
@@ -62,7 +63,7 @@ def _assign_properties(self, entity_name: str, formatted_dict: dict) -> None:
6263

6364
# ! This has changed and now permId, label, and description do not exist on the property assignments!!
6465
for prop in assignments:
65-
properties[prop.permId].update(
66+
properties[prop.get_property_type().permId].update(
6667
{
6768
"label": prop.label,
6869
"description": prop.description,
@@ -180,4 +181,4 @@ def get_vocabulary_dict(self) -> dict:
180181
formatted_dict[code]["terms"] = {}
181182

182183
# We return the sorted dictionary in order to have a consistent order for inheritance
183-
return dict(sorted(formatted_dict.items(), key=lambda item: item[0].count(".")))
184+
return dict(sorted(formatted_dict.items(), key=lambda item: item[0].count(".")))

0 commit comments

Comments
 (0)