Skip to content

Commit 710f354

Browse files
rule_stops accepts bool as well
1 parent 87f0870 commit 710f354

File tree

1 file changed

+4
-2
lines changed
  • src/eligibility_signposting_api/model

1 file changed

+4
-2
lines changed

src/eligibility_signposting_api/model/rules.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ class IterationRule(BaseModel):
105105
@field_validator("rule_stop", mode="before")
106106
@staticmethod
107107
def parse_yn_to_bool(v: str | bool) -> bool:
108+
if isinstance(v, bool):
109+
return v
108110
if isinstance(v, str):
109-
return v.upper() == "Y"
110-
return bool(v)
111+
return v.strip().upper() == "Y"
112+
return False
111113

112114
model_config = {"populate_by_name": True, "extra": "ignore"}
113115

0 commit comments

Comments
 (0)