def _wrapped_view(request, *args, **kwargs):
    if test_func(request.user):
        return view_func(request, *args, **kwargs)
How to pass Django request object in user_passes_test decorator callable function