Skip to content

Commit

Permalink
use validator
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed Apr 5, 2024
1 parent 81f1900 commit 6310224
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genotype_api/dto/sample.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module for the sample DTOs."""

from datetime import datetime
from pydantic import BaseModel, validator
from pydantic import BaseModel, field_validator
from genotype_api.constants import Sexes, Status, Types
from genotype_api.dto.genotype import GenotypeResponse

Expand All @@ -27,7 +27,7 @@ class SampleResponse(BaseModel):
analyses: list[AnalysisOnSample] | None = None
detail: SampleDetail | None = None

@validator("detail")
@field_validator("detail")
def get_detail(cls, value, values) -> SampleDetail | None:
analyses = values.get("analyses")
if analyses:
Expand Down

0 comments on commit 6310224

Please sign in to comment.