From 14aea2b4d4b89549a7e95f0bca35aa2f7ea6db85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yngve=20H=C3=B8iseth?= Date: Tue, 12 Nov 2019 03:52:23 +0100 Subject: [PATCH] Allow returning bool from test_func (#220) --- django-stubs/contrib/auth/mixins.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/contrib/auth/mixins.pyi b/django-stubs/contrib/auth/mixins.pyi index e75f62f..50b7263 100644 --- a/django-stubs/contrib/auth/mixins.pyi +++ b/django-stubs/contrib/auth/mixins.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, List +from typing import Any, Callable, List, Optional from django import http 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: ... class UserPassesTestMixin(AccessMixin): - def test_func(self) -> None: ... + def test_func(self) -> Optional[bool]: ... def get_test_func(self) -> Callable: ... def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...