def logged_in(func, *args, **kwargs): if g.auth is None: raise AuthorizationException('No existing session.') else: return func(*args, **kwargs)