add to tasks service
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user