

def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME):
    '\n    Decorator for views that checks that the user is logged in, redirecting\n    to the log-in page if necessary.\n    '
    actual_decorator = user_passes_test((lambda u: u.is_authenticated()), redirect_field_name=redirect_field_name)
    if function:
        return actual_decorator(function)
    return actual_decorator

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/contrib/auth/decorators.py login_required/original