Allow returning bool from test_func (#220)

This commit is contained in:
Yngve Høiseth
2019-11-12 03:52:23 +01:00
committed by Maksim Kurnikov
parent 287c64d6fb
commit 14aea2b4d4

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, List from typing import Any, Callable, List, Optional
from django import http from django import http
from django.http.response import HttpResponse, HttpResponseRedirect from django.http.response import HttpResponse, HttpResponseRedirect
@@ -23,6 +23,6 @@ class PermissionRequiredMixin(AccessMixin):
def dispatch(self, request: http.HttpRequest, *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) -> Optional[bool]: ...
def get_test_func(self) -> Callable: ... def get_test_func(self) -> Callable: ...
def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...