Ejemplo n.º 1
0
def keys():
    form = WriteKeyForm()
    if request.method == 'POST':
        wk = WriteKey()
        form.populate_obj(wk)
        wk.put()
        return redirect(url_for('api.v1.admin.keys'))
    keys_obj = WriteKey.query()
    return render_template('api/v1/admin/keys.html', form=form, keys=keys_obj)
Ejemplo n.º 2
0
def keys():
    form = WriteKeyForm()
    if request.method == "POST":
        wk = WriteKey()
        form.populate_obj(wk)
        wk.put()
        return redirect(url_for("api.v1.admin.keys"))
    keys_obj = WriteKey.query()
    return render_template("api/v1/admin/keys.html", form=form, keys=keys_obj)
Ejemplo n.º 3
0
 def wrapped(*args, **kwargs):
     denied = {'success': False, 'msg': 'Write permission denied.'}
     api_key = param('api_key')
     if not api_key:
         return jsonify(denied)
     key = WriteKey.query(WriteKey.api_key == api_key)
     if not key.count():
         return jsonify(denied)
     return func(*args, **kwargs)
Ejemplo n.º 4
0
 def wrapped(*args, **kwargs):
     denied = {"success": False, "msg": "Write permission denied."}
     api_key = param("api_key")
     if not api_key:
         return jsonify(denied)
     key = WriteKey.query(WriteKey.api_key == api_key)
     if not key.count():
         return jsonify(denied)
     return func(*args, **kwargs)