示例#1
0
def admin_key_types(key_id=None):
    if key_id is None:
        data = {}
        for class_id in KEY_CLASSES:
            data[class_id] = KEY_CLASSES.get(class_id).name

        return jsonify(data)
    else:
        key_class = get_key_class(key_id)
        data = {
            'id': key_class.id,
            'name': key_class.name,
            'templates': key_class.templates
        }
        return jsonify(data)
示例#2
0
def admin_key_types():
    data = {}
    for class_id in KEY_CLASSES:
        data[class_id] = KEY_CLASSES.get(class_id).name

    return jsonify(data)