Skip to content

Commit

Permalink
fix: UserAdmin accepts AbstractUser (#2139)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Sobolev <[email protected]>
  • Loading branch information
vadimshvetsov and sobolevn authored May 9, 2024
1 parent a26f96a commit 57c22f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions django-stubs/contrib/auth/admin.pyi
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
from typing import Any
from typing import Any, TypeVar

from django.contrib import admin
from django.contrib.auth.models import Group, User
from django.contrib.auth.models import AbstractUser, Group
from django.http.request import HttpRequest
from django.http.response import HttpResponse

_AbstractUserT = TypeVar("_AbstractUserT", bound=AbstractUser)

csrf_protect_m: Any
sensitive_post_parameters_m: Any

class GroupAdmin(admin.ModelAdmin[Group]): ...

class UserAdmin(admin.ModelAdmin[User]):
class UserAdmin(admin.ModelAdmin[_AbstractUserT]):
change_user_password_template: Any
add_fieldsets: Any
add_form: Any
Expand Down

0 comments on commit 57c22f1

Please sign in to comment.