From 0e07b4123166b2dcac3fa56e5678b39da9979167 Mon Sep 17 00:00:00 2001 From: Michael Harbarth Date: Thu, 25 Jul 2024 18:22:19 +0200 Subject: [PATCH] refactor: implement requested changes from review --- polarion_rest_api_client/data_models.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/polarion_rest_api_client/data_models.py b/polarion_rest_api_client/data_models.py index 3f08209..3a87416 100644 --- a/polarion_rest_api_client/data_models.py +++ b/polarion_rest_api_client/data_models.py @@ -11,11 +11,7 @@ import json import typing as t -field_at_start: list[str] | None = None -fields_at_end: list[str] | None = None -sidebar_work_item_fields: list[str] | None = None -fields_at_end_as_table: bool = False - +BOOLEAN_RENDERING_PROPERTIES = ["fieldsAtEndAsTable", "hidden"] RENDERING_LAYOUT_FIELDS = { "fieldsAtEndAsTable": "fields_at_end_as_table", "fieldsAtStart": "fields_at_start", @@ -283,7 +279,7 @@ def __init__( for prop in _properties: key = prop["key"] value = prop.get("value", "") - if key in ["fieldsAtEndAsTable", "hidden"]: + if key in BOOLEAN_RENDERING_PROPERTIES: value = value == "true" else: value = value.split(",")