Skip to content

Commit 3b3c02f

Browse files
committed
small refactor
1 parent a98074c commit 3b3c02f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arho_feature_template/core/plan_regulation_config.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class PlanRegulationConfig:
133133
category_only: bool
134134
value_type: ValueType | None
135135
unit: Unit | None
136-
child_regulations: list[PlanRegulationConfig] | None
136+
child_regulations: list[PlanRegulationConfig]
137137

138138
@classmethod
139139
def from_dict(cls, data: dict) -> PlanRegulationConfig:
@@ -154,7 +154,5 @@ def from_dict(cls, data: dict) -> PlanRegulationConfig:
154154
def add_name(self, code_to_name_mapping: dict[str, dict[str, str]], language: Literal["fin", "eng", "swe"]):
155155
language_to_name_dict = code_to_name_mapping.get(self.regulation_code)
156156
self.name = language_to_name_dict[language] if language_to_name_dict else self.regulation_code
157-
if not self.child_regulations:
158-
return
159157
for regulation in self.child_regulations:
160158
regulation.add_name(code_to_name_mapping, language)

0 commit comments

Comments
 (0)