Skip to content

Fix error with role permission mixins

All three of the role permission mixins have a bug where if a user is not logged in it will show an error message instead of redirecting him to the login page. To fix, insert

if not request.user.is_authenticated:
    return self.handle_no_permission()

at the beginning of each dispatch(self, request, *args, **kwargs) method.