def post_update_author(author_id):
    form = UpdateForm(request.form, csrf_enabled=False)
    if form.validate():
        json = {
            "request": {
                "substance": {
                    "author_id": form.author_id.data,
                    "author_name": form.author_name.data,
                    "mail_address": form.mail_address.data,
                    "valid": True if form.valid.data == "True" else False,
                }
            }
        }
        req = json.get("request")
        ret = AuthorFacade.update(req, secure=False).get("response")
        if ret and ret.get("result") == const.RESPONSE_RESULT_SUCCESSFUL:
            return redirect("/admin/author/list")
        else:
            form.errors["exceptions"] = [ret.get("message")]

    json = {
        "request": {
            "substance": {
                "author_id": author_id
            }
        }
    }
    req = json.get("request")
    res = KitFacade.list(req)
    kits = res.get("response").get("substance").get("items")
    return render_template("author/update.html", form=form, kits=kits)
def update_author():
    json = {
        "request": {
            "credential": {
                "author_id": "a2e006bc0d489746ee6ac9415da7ef352091bbe8",
                "token": "b941295b36824f0fc19cc473ba9d6b67866b2709"
            },
            "substance": {
                "author_id": "a2e006bc0d489746ee6ac9415da7ef352091bbe8",
                "author_name": u"Masahiro Atsumi desu!",
                "mail_address": "*****@*****.**",
                "valid": True,
                }
        }
    }

    req = json.get("request")
    res = AuthorFacade.update(req)
    return jsonify(res)