mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-28 21:15:26 -05:00
chore:bump dependencies and fix errors (#2601)
* bump dependencies and fix errors * fix depreciated arg * properly handle validation errors
This commit is contained in:
@@ -25,7 +25,7 @@ remember_me_duration = timedelta(days=14)
|
||||
class CustomOAuth2Form(OAuth2PasswordRequestForm):
|
||||
def __init__(
|
||||
self,
|
||||
grant_type: str = Form(None, regex="password"),
|
||||
grant_type: str = Form(None, pattern="password"),
|
||||
username: str = Form(...),
|
||||
password: str = Form(...),
|
||||
remember_me: bool = Form(False),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from inspect import signature
|
||||
|
||||
from fastapi.exceptions import HTTPException, ValidationError
|
||||
from fastapi.exceptions import HTTPException, RequestValidationError
|
||||
from pydantic import ValidationError
|
||||
|
||||
|
||||
def make_dependable(cls):
|
||||
@@ -25,7 +26,7 @@ def make_dependable(cls):
|
||||
try:
|
||||
signature(init_cls_and_handle_errors).bind(*args, **kwargs)
|
||||
return cls(*args, **kwargs)
|
||||
except ValidationError as e:
|
||||
except (ValidationError, RequestValidationError) as e:
|
||||
for error in e.errors():
|
||||
error["loc"] = ["query"] + list(error["loc"])
|
||||
raise HTTPException(422, detail=e.errors()) from None
|
||||
|
||||
Reference in New Issue
Block a user