コード例 #1
0
def user_blogs(user_id=None):
    try:
        test_session = session['email']
    except KeyError as e:
        return make_response(login_page())
    else:
        if user_id is not None:
            user = User.getById(user_id)
        else:
            user = User.getByEmail(session['email'])

        blogs = user.getBlogs()
        return render_template("user_blogs.html",
                               blogs=blogs,
                               email=user.email)
コード例 #2
0
def identity(payload):
    user_id = payload['identity']
    return User.getById(user_id)