human
I wrote the below code

    if only_active:
        def redirect_func(user):
            return (not (user.is_authenticated() and user.is_active))
    else:
        def redirect_func(user):
            return (not user.is_authenticated())
    return user_access_decorator(redirect_func, redirect_field=redirect, redirect_url_func=(lambda : login_url))(func)

What's a good function header?

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

def login_required(func, login_url=None, redirect=REDIRECT_FIELD_NAME, only_active=True):