fix(mixins): Use the correct test function

This commit is contained in:
Tom Hubrecht 2024-09-19 11:40:16 +02:00
parent 36ccc6be24
commit ea3c5cf6fd
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc

View file

@ -7,8 +7,8 @@ from dgsi.models import User
class StaffRequiredMixin(UserPassesTestMixin): class StaffRequiredMixin(UserPassesTestMixin):
request: HttpRequest request: HttpRequest
def test_func(self) -> bool | None: def test_func(self) -> bool:
if self.request.user.is_authenticated: if not self.request.user.is_authenticated:
return False return False
assert isinstance(self.request.user, User) assert isinstance(self.request.user, User)