def revoke_api_key(service_id, key_id): key_name = api_key_api_client.get_api_keys(service_id=service_id, key_id=key_id)['apiKeys'][0]['name'] if request.method == 'GET': return render_template( 'views/api/keys/revoke.html', key_name=key_name ) elif request.method == 'POST': api_key_api_client.revoke_api_key(service_id=service_id, key_id=key_id) flash('‘{}’ was revoked'.format(key_name), 'default_with_tick') return redirect(url_for('.api_keys', service_id=service_id))
def revoke_api_key(service_id, key_id): key_name = api_key_api_client.get_api_keys(service_id=service_id, key_id=key_id)['apiKeys'][0]['name'] if request.method == 'GET': return render_template( 'views/api/keys/revoke.html', key_name=key_name ) elif request.method == 'POST': api_key_api_client.revoke_api_key(service_id=service_id, key_id=key_id) flash('‘{}’ was revoked'.format(key_name), 'default_with_tick') return redirect(url_for('.api_keys', service_id=service_id))
def revoke_api_key(service_id, key_id): key_name = current_service.get_api_key(key_id)['name'] if request.method == 'GET': flash([ "Are you sure you want to revoke ‘{}’?".format(key_name), "You will not be able to use this API key to connect to Catalyst Notify." ], 'revoke this API key') return render_template('views/api/keys.html', ) elif request.method == 'POST': api_key_api_client.revoke_api_key(service_id=service_id, key_id=key_id) flash('‘{}’ was revoked'.format(key_name), 'default_with_tick') return redirect(url_for('.api_keys', service_id=service_id))
def revoke_api_key(service_id, key_id): key_name = current_service.get_api_key(key_id)["name"] if request.method == "GET": flash( [ "{} ‘{}’?".format(_l("Are you sure you want to revoke"), key_name), _l("You will not be able to use this API key to connect to GC Notify" ), ], "revoke this API key", ) return render_template("views/api/keys.html", ) elif request.method == "POST": api_key_api_client.revoke_api_key(service_id=service_id, key_id=key_id) flash("‘{}’ {}".format(key_name, _l("was revoked")), "default_with_tick") return redirect(url_for(".api_keys", service_id=service_id))