Skip to content

Commit 15b17f2

Browse files
committed
Fix mypy errors
1 parent 4dcbf13 commit 15b17f2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

mypy.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ ignore_missing_imports = True
4141
[mypy-oauthlib.*]
4242
# Remove this when oauthlib stubs are present
4343
ignore_missing_imports = True
44+
45+
[mypy-qrcode.*]
46+
# Remove this when qrcode stubs are present
47+
ignore_missing_imports = True

styleguide_example/blog_examples/admin_2fa/services.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import pyotp
2-
from django.contrib.auth import get_user_model
32
from django.core.exceptions import ValidationError
43

5-
from .models import UserTwoFactorAuthData
4+
from styleguide_example.users.models import BaseUser
65

7-
User = get_user_model()
6+
from .models import UserTwoFactorAuthData
87

98

10-
def user_two_factor_auth_data_create(*, user: User) -> UserTwoFactorAuthData:
9+
def user_two_factor_auth_data_create(*, user: BaseUser) -> UserTwoFactorAuthData:
1110
if hasattr(user, "two_factor_auth_data"):
1211
raise ValidationError("Can not have more than one 2FA related data.")
1312

0 commit comments

Comments
 (0)