def before_request(): g.session = request.environ['xiaomen.session'] g.current_user = get_current_user() #TODO remove if g.current_user: g.topic_notify = lambda: topic_notify(g.current_user.id)
def unread(uid): has = topic_notify(int(uid)) return has