コード例 #1
0
def post_update_password_author(author_id):
    form = UpdatePasswordForm(request.form, csrf_enabled=False)
    if form.validate():
        json = {
            "request": {
                "substance": {
                    "author_id": form.author_id.data,
                    "password": form.password.data,
                }
            }
        }
        req = json.get("request")
        ret = AuthorFacade.update_password(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_password.html", form=form, kits=kits)
コード例 #2
0
def update_password_author():
    json = {
        "request": {
            "credential": {
                "author_id": "a2e006bc0d489746ee6ac9415da7ef352091bbe8",
                "token": "b941295b36824f0fc19cc473ba9d6b67866b2709"
            },
            "substance": {
                "author_id": "a2e006bc0d489746ee6ac9415da7ef352091bbe8",
                "password": "******"
            }
        }
    }

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