Skip to content

Commit

Permalink
fix target-settings model validator
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Santana <[email protected]>
  • Loading branch information
SantanaTiago committed Jan 15, 2025
1 parent fd276df commit ab3e0f0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions deepsearch/documents/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ class TargetSettings(BaseModel):
add_annotations: Optional[bool] = None

@model_validator(mode="after")
@classmethod
def check_raw_or_ann(cls, values):
if (values.get("add_raw_pages") is None) and (
values.get("add_annotations") is None
):
def check_raw_or_ann(self):
if self.add_raw_pages is None and self.add_annotations is None:
raise ValueError("either 'add_raw_pages' or 'add_annotations' is required")
return values
return self

0 comments on commit ab3e0f0

Please sign in to comment.