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)
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)
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)
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)