Fix many type errors.

This commit is contained in:
Tom Hacohen
2020-12-29 13:22:36 +02:00
parent e13f26ec56
commit 794b5f3983
12 changed files with 87 additions and 64 deletions

View File

@@ -1,9 +1,9 @@
from django.contrib.auth import get_user_model
from django.db import models
from django.utils import timezone
from django.utils.crypto import get_random_string
from myauth.models import get_typed_user_model
User = get_user_model()
User = get_typed_user_model()
def generate_key():

View File

@@ -1,13 +1,13 @@
import typing as t
from dataclasses import dataclass
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from myauth.models import UserType, get_typed_user_model
from . import app_settings
User = get_user_model()
User = get_typed_user_model()
@dataclass
@@ -15,7 +15,7 @@ class CallbackContext:
"""Class for passing extra context to callbacks"""
url_kwargs: t.Dict[str, t.Any]
user: t.Optional[User] = None
user: t.Optional[UserType] = None
def get_user_queryset(queryset, context: CallbackContext):