Skip to content

Commit 45537d7

Browse files
committed
fix: Claim model email validation
1 parent 6902b8b commit 45537d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: models/claim.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ class ClaimModel(BaseModel):
4747

4848
@field_validator("policyholder_email")
4949
@classmethod
50-
def _policyholder_email_validator(cls, email: str) -> str:
51-
if not re.match(EMAIL_PARSER_R, email):
50+
def _policyholder_email_validator(cls, policyholder_email: str) -> str:
51+
if policyholder_email and not re.match(EMAIL_PARSER_R, policyholder_email):
5252
raise ValueError(
5353
'Invalid email address, please use a valid email (e.g. "[email protected]").'
5454
)
55-
return email
55+
return policyholder_email
5656

5757
@staticmethod
5858
def editable_fields() -> Set[str]:

0 commit comments

Comments
 (0)