def requires_login():

    def wrapper(f):
        @wraps(f)
        def wrapped(*args, **kwargs):
            if not get_user(args[0].request):
                raise HTTP_401("I can't let you do that")
            return f(*args, **kwargs)
        return wrapped
    return wrapper
Wrapper for methods that require login
dataset/ETHPy150Open nullism/pycnic/examples/full-auth.py/requires_login