human
I wrote the below code

    if (login_url is None):
        login_url = reverse_lazy('customer:login')
    @wraps(view_func)
    def _checklogin(request, *args, **kwargs):
        if (request.user.is_active and request.user.is_staff):
            return view_func(request, *args, **kwargs)
        if (not user_is_authenticated(request.user)):
            path = request.build_absolute_uri()
            (login_scheme, login_netloc) = parse.urlparse(login_url)[:2]
            (current_scheme, current_netloc) = parse.urlparse(path)[:2]
            if (((not login_scheme) or (login_scheme == current_scheme)) and ((not login_netloc) or (login_netloc == current_netloc))):
                path = request.get_full_path()
            messages.warning(request, _('You    must    log    in    to    access    this    page'))
            return redirect_to_login(path, login_url, REDIRECT_FIELD_NAME)
        else:
            raise PermissionDenied
    return _checklogin

What's a good function header?
assistant
#Here's a good function header.

def staff_member_required(view_func, login_url=None):