Esempio n. 1
0
def client():
    if request.method == 'GET':
        clients = Client.get_all(g.start, g.limit)
        return render_template('client.html', clients=clients)

    redirect_uri = request.form.get('redirect_uri', default='')
    name = request.form.get('name', default='')
    if not (redirect_uri and name):
        flash(u'缺少需要填写的', 'error')
        return redirect(url_for('oauth.client'))

    Client.create(name, [redirect_uri], ['email'])
    return redirect(url_for('oauth.client'))
Esempio n. 2
0
def client():
    if request.method == "GET":
        clients = Client.get_all(g.start, g.limit)
        return render_template("client.html", clients=clients)

    redirect_uri = request.form.get("redirect_uri", default="")
    name = request.form.get("name", default="")
    if not (redirect_uri and name):
        flash(u"缺少需要填写的", "error")
        return redirect(url_for("oauth.client"))

    Client.create(name, [redirect_uri], ["email"])
    return redirect(url_for("oauth.client"))