From a8f6566dd377ac60b321f35e2313df6d6abc66dd Mon Sep 17 00:00:00 2001 From: ewuerger Date: Tue, 12 Dec 2023 10:05:35 +0100 Subject: [PATCH] fix(serializer): Fix `PhysicalComponent` serializer --- capella2polarion/elements/serialize.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/capella2polarion/elements/serialize.py b/capella2polarion/elements/serialize.py index dc2e6d95..18ac9de3 100644 --- a/capella2polarion/elements/serialize.py +++ b/capella2polarion/elements/serialize.py @@ -311,9 +311,8 @@ def _include_nature_in_type( """Return attributes for a ``PhysicalComponent``.""" work_item = _include_actor_in_type(obj, ctx) xtype = work_item.type - if obj.nature is not None: - # pylint: disable-next=attribute-defined-outside-init - work_item.type = f"{xtype}{obj.nature.name.capitalize()}" + nature = [obj.nature.name, ""][obj.nature == "UNSET"] + work_item.type = f"{xtype}{nature.capitalize()}" return work_item