mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +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
|
||||
self.base = ids_dict.get("@base", "xs:string")[3:]
|
||||
for key, value in ids_dict.items():
|
||||
key = key.split(":")[-1]
|
||||
if key in ["@base", "annotation"]:
|
||||
continue
|
||||
if isinstance(value, dict):
|
||||
self.options[key.split(":")[-1]] = value["@value"]
|
||||
if key == "enumeration" and isinstance(value, dict):
|
||||
self.options[key] = [value["@value"]] # A single enumeration value which is pretty meaningless
|
||||
elif isinstance(value, dict):
|
||||
self.options[key] = value["@value"]
|
||||
else:
|
||||
self.options[key.split(":")[-1]] = [v["@value"] for v in value]
|
||||
self.options[key] = [v["@value"] for v in value]
|
||||
return self
|
||||
|
||||
def asdict(self):
|
||||
|
||||
Reference in New Issue
Block a user