diff --git a/django-stubs/contrib/auth/__init__.pyi b/django-stubs/contrib/auth/__init__.pyi index 2e1088a..895a981 100644 --- a/django-stubs/contrib/auth/__init__.pyi +++ b/django-stubs/contrib/auth/__init__.pyi @@ -2,7 +2,7 @@ from typing import Any, List, Optional, Type, Union from django.contrib.auth.backends import ModelBackend from django.contrib.auth.base_user import AbstractBaseUser -from django.contrib.auth.models import AbstractUser, AnonymousUser +from django.contrib.auth.models import AnonymousUser from django.core.handlers.wsgi import WSGIRequest from django.db.models.base import Model from django.db.models.options import Options @@ -29,6 +29,6 @@ def logout(request: HttpRequest) -> None: ... def get_user_model() -> Type[Model]: ... def get_user(request: HttpRequest) -> Union[AbstractBaseUser, AnonymousUser]: ... def get_permission_codename(action: str, opts: Options) -> str: ... -def update_session_auth_hash(request: HttpRequest, user: AbstractUser) -> None: ... +def update_session_auth_hash(request: HttpRequest, user: AbstractBaseUser) -> None: ... default_app_config: str diff --git a/django-stubs/contrib/auth/forms.pyi b/django-stubs/contrib/auth/forms.pyi index e658429..6271f45 100644 --- a/django-stubs/contrib/auth/forms.pyi +++ b/django-stubs/contrib/auth/forms.pyi @@ -1,7 +1,7 @@ from typing import Any, Dict, Iterator, Optional from django.contrib.auth.base_user import AbstractBaseUser -from django.contrib.auth.models import AbstractUser, User +from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.core.exceptions import ValidationError from django.core.handlers.wsgi import WSGIRequest @@ -86,6 +86,6 @@ class AdminPasswordChangeForm(forms.Form): password1: Any = ... password2: Any = ... user: User = ... - def __init__(self, user: AbstractUser, *args: Any, **kwargs: Any) -> None: ... + def __init__(self, user: AbstractBaseUser, *args: Any, **kwargs: Any) -> None: ... def clean_password2(self) -> str: ... - def save(self, commit: bool = ...) -> AbstractUser: ... + def save(self, commit: bool = ...) -> AbstractBaseUser: ... diff --git a/django-stubs/test/client.pyi b/django-stubs/test/client.pyi index ece73fe..7e0f752 100644 --- a/django-stubs/test/client.pyi +++ b/django-stubs/test/client.pyi @@ -2,7 +2,7 @@ from io import BytesIO from types import TracebackType from typing import Any, Dict, List, Optional, Pattern, Tuple, Type, Union -from django.contrib.auth.models import AbstractUser +from django.contrib.auth.base_user import AbstractBaseUser from django.contrib.sessions.backends.base import SessionBase from django.core.handlers.base import BaseHandler from django.http.cookie import SimpleCookie @@ -126,7 +126,7 @@ class Client(RequestFactory): @property def session(self) -> SessionBase: ... def login(self, **credentials: Any) -> bool: ... - def force_login(self, user: AbstractUser, backend: Optional[str] = ...) -> None: ... + def force_login(self, user: AbstractBaseUser, backend: Optional[str] = ...) -> None: ... def logout(self) -> None: ... def conditional_content_removal(request: HttpRequest, response: HttpResponseBase) -> HttpResponse: ...