mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 21:14:49 +08:00
Merge pull request #24 from roderik333/replace-wsgirequest-in-loginrequiredmixin
Replaced WSGIRequest with http.HttpRequest in mixin:LoginRequiredMixin
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
from typing import Any, Callable, List, Optional
|
from typing import Any, Callable, List, Optional
|
||||||
|
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django import http
|
||||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||||
|
|
||||||
class AccessMixin:
|
class AccessMixin:
|
||||||
@@ -14,15 +14,15 @@ class AccessMixin:
|
|||||||
def handle_no_permission(self) -> HttpResponseRedirect: ...
|
def handle_no_permission(self) -> HttpResponseRedirect: ...
|
||||||
|
|
||||||
class LoginRequiredMixin(AccessMixin):
|
class LoginRequiredMixin(AccessMixin):
|
||||||
def dispatch(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
|
|
||||||
class PermissionRequiredMixin(AccessMixin):
|
class PermissionRequiredMixin(AccessMixin):
|
||||||
permission_required: Any = ...
|
permission_required: Any = ...
|
||||||
def get_permission_required(self) -> List[str]: ...
|
def get_permission_required(self) -> List[str]: ...
|
||||||
def has_permission(self) -> bool: ...
|
def has_permission(self) -> bool: ...
|
||||||
def dispatch(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
|
|
||||||
class UserPassesTestMixin(AccessMixin):
|
class UserPassesTestMixin(AccessMixin):
|
||||||
def test_func(self) -> None: ...
|
def test_func(self) -> None: ...
|
||||||
def get_test_func(self) -> Callable: ...
|
def get_test_func(self) -> Callable: ...
|
||||||
def dispatch(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user