Skip to content

Commit

Permalink
[#62] fixing validator for user subject areas
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Apr 16, 2024
1 parent a98a0fc commit afe3ec8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hsclient/json_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ class User(BaseModel):

@field_validator("subject_areas", mode='before')
def split_subject_areas(cls, value):
return value.split(", ") if value else []
if isinstance(value, str):
return value.split(", ")
if value is None:
return []
return value


class ResourcePreview(BaseModel):
Expand Down

0 comments on commit afe3ec8

Please sign in to comment.