Pydantic does't init values in validators I guess

pull/1/head
Estelle Poulin 1 year ago
parent cd319b0ab1
commit f284983368

@ -192,7 +192,7 @@ class ImageToImageUpscaleRequestBody(BaseModel):
@validator("width", always=True) @validator("width", always=True)
def mutually_exclusive(cls, v, values): def mutually_exclusive(cls, v, values):
if values["height"] is not None and v: if values.get("height") is not None and v:
raise ValueError("You can only specify one of width and height.") raise ValueError("You can only specify one of width and height.")
return v return v

Loading…
Cancel
Save