mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 08:56:34 +00:00
See #3953. Fix bug where IDSes with a single enumeration value didn't validate.
This commit is contained in:
@@ -919,12 +919,15 @@ class Restriction:
|
|||||||
return self
|
return self
|
||||||
self.base = ids_dict.get("@base", "xs:string")[3:]
|
self.base = ids_dict.get("@base", "xs:string")[3:]
|
||||||
for key, value in ids_dict.items():
|
for key, value in ids_dict.items():
|
||||||
|
key = key.split(":")[-1]
|
||||||
if key in ["@base", "annotation"]:
|
if key in ["@base", "annotation"]:
|
||||||
continue
|
continue
|
||||||
if isinstance(value, dict):
|
if key == "enumeration" and isinstance(value, dict):
|
||||||
self.options[key.split(":")[-1]] = value["@value"]
|
self.options[key] = [value["@value"]] # A single enumeration value which is pretty meaningless
|
||||||
|
elif isinstance(value, dict):
|
||||||
|
self.options[key] = value["@value"]
|
||||||
else:
|
else:
|
||||||
self.options[key.split(":")[-1]] = [v["@value"] for v in value]
|
self.options[key] = [v["@value"] for v in value]
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def asdict(self):
|
def asdict(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user