Skip to content

Commit

Permalink
fix: Claim model email validation
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jan 30, 2024
1 parent 6902b8b commit 45537d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class ClaimModel(BaseModel):

@field_validator("policyholder_email")
@classmethod
def _policyholder_email_validator(cls, email: str) -> str:
if not re.match(EMAIL_PARSER_R, email):
def _policyholder_email_validator(cls, policyholder_email: str) -> str:
if policyholder_email and not re.match(EMAIL_PARSER_R, policyholder_email):
raise ValueError(
'Invalid email address, please use a valid email (e.g. "[email protected]").'
)
return email
return policyholder_email

@staticmethod
def editable_fields() -> Set[str]:
Expand Down

0 comments on commit 45537d7

Please sign in to comment.