-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fastapi_auth_partner: migrate to pydantic 2
- Loading branch information
1 parent
574380e
commit e803926
Showing
2 changed files
with
12 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,31 @@ | ||
# Copyright (c) Akretion 2020 | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from extendable_pydantic import ExtendableModelMeta | ||
from extendable_pydantic import StrictExtendableBaseModel | ||
|
||
from odoo.addons.pydantic import utils | ||
from pydantic import ConfigDict | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class AuthLoginInput(BaseModel, metaclass=ExtendableModelMeta): | ||
class AuthLoginInput(StrictExtendableBaseModel): | ||
login: str | ||
password: str | ||
|
||
|
||
class AuthRegisterInput(BaseModel, metaclass=ExtendableModelMeta): | ||
class AuthRegisterInput(StrictExtendableBaseModel): | ||
name: str | ||
login: str | ||
password: str | ||
|
||
|
||
class AuthForgetPasswordInput(BaseModel, metaclass=ExtendableModelMeta): | ||
class AuthForgetPasswordInput(StrictExtendableBaseModel): | ||
login: str | ||
|
||
|
||
class AuthSetPasswordInput(BaseModel, metaclass=ExtendableModelMeta): | ||
class AuthSetPasswordInput(StrictExtendableBaseModel): | ||
token: str | ||
password: str | ||
|
||
|
||
class AuthPartnerResponse(BaseModel, metaclass=ExtendableModelMeta): | ||
class AuthPartnerResponse(StrictExtendableBaseModel): | ||
login: str | ||
|
||
class Config: | ||
orm_mode = True | ||
getter_dict = utils.GenericOdooGetter | ||
model_config = ConfigDict(from_attributes=True) |