add to tasks service

This commit is contained in:
IluaAir
2025-08-29 22:10:15 +03:00
parent 07f14b0564
commit bd9786c14c
3 changed files with 23 additions and 4 deletions

View File

@@ -36,7 +36,9 @@ class Date(BaseModel):
@model_validator(mode="after")
def check_dates(self):
if self.date_from and self.date_to and self.date_to < self.date_from:
raise HTTPException(status_code=422, detail="date_to cannot be less than date_from")
raise HTTPException(
status_code=422, detail="date_to cannot be less than date_from"
)
return self