Skip to content

Commit 5459016

Browse files
committed
Fix fastapi-users#1262: Remove __init__ in models protocols to fix typing error with Pylance
1 parent aa4344f commit 5459016

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fastapi_users/models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ class UserProtocol(Protocol[ID]):
1313
is_superuser: bool
1414
is_verified: bool
1515

16-
def __init__(self, *args, **kwargs) -> None:
17-
... # pragma: no cover
18-
1916

2017
class OAuthAccountProtocol(Protocol[ID]):
2118
"""OAuth account protocol that ORM model should follow."""
@@ -28,9 +25,6 @@ class OAuthAccountProtocol(Protocol[ID]):
2825
account_id: str
2926
account_email: str
3027

31-
def __init__(self, *args, **kwargs) -> None:
32-
... # pragma: no cover
33-
3428

3529
UP = TypeVar("UP", bound=UserProtocol)
3630
OAP = TypeVar("OAP", bound=OAuthAccountProtocol)
@@ -39,6 +33,12 @@ def __init__(self, *args, **kwargs) -> None:
3933
class UserOAuthProtocol(UserProtocol[ID], Generic[ID, OAP]):
4034
"""User protocol including a list of OAuth accounts."""
4135

36+
id: ID
37+
email: str
38+
hashed_password: str
39+
is_active: bool
40+
is_superuser: bool
41+
is_verified: bool
4242
oauth_accounts: List[OAP]
4343

4444

0 commit comments

Comments
 (0)