def get_current_user(): '''Return current user; otherwise return unautorized user object''' session = get_current_session() if "user" not in session: return None # TODO: return anonymous User() object return session['user']
def session(self): '''Return user session''' return get_current_session()