Skip to content

Commit 7b503f2

Browse files
authored
Fix missing TypeAlias for request.user (typeddjango#758)
`_UserModel` was replaced with `_User` in `django-stubs` 5.2.0.
1 parent 1a34281 commit 7b503f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rest_framework-stubs/request.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ from contextlib import AbstractContextManager, contextmanager
44
from types import TracebackType
55
from typing import Any
66

7-
from django.contrib.auth.base_user import AbstractBaseUser, _UserModel
8-
from django.contrib.auth.models import AnonymousUser
7+
from django.contrib.auth.base_user import AbstractBaseUser
8+
from django.contrib.auth.models import AnonymousUser, _User
99
from django.http import HttpRequest
1010
from django.http.request import _ImmutableQueryDict
1111
from rest_framework.authentication import BaseAuthentication
@@ -72,9 +72,9 @@ class Request(HttpRequest):
7272
@property
7373
def data(self) -> dict[str, Any]: ...
7474
@property
75-
def user(self) -> _UserModel | AnonymousUser: ...
75+
def user(self) -> _User | AnonymousUser: ...
7676
@user.setter
77-
def user(self, value: _UserModel | AnonymousUser) -> None: ...
77+
def user(self, value: _User | AnonymousUser) -> None: ...
7878
@property
7979
def auth(self) -> Token | Any: ...
8080
@auth.setter

0 commit comments

Comments
 (0)