Esempio n. 1
0
def update_setting(setting_id):
    key = request.form["key"]
    name = request.form["name"]
    value = request.form["value"]
    value_type = request.form["value_type"]
    if key == "cert_file" or key == "key_file":
        if value and not file_util.is_file(value):
            return jsonify(
                Msg(False,
                    gettext("File <%(file)s> does not exist.", file=value)))
    config.update_setting(setting_id, key, name, value, value_type)
    if key == "v2_template_config":
        __v2_config_changed = True
    return jsonify(Msg(
        True,
        gettext("Updated successfully."),
    ))
Esempio n. 2
0
def update_setting(setting_id):
    key = request.form['key']
    name = request.form['name']
    value = request.form['value']
    value_type = request.form['value_type']
    if key == 'cert_file' or key == 'key_file':
        if value and not file_util.is_file(value):
            return jsonify(
                Msg(False,
                    gettext(u'File <%(file)s> does not exist.', file=value)))
    config.update_setting(setting_id, key, name, value, value_type)
    if key == 'v2_template_config':
        v2_jobs.__v2_config_changed = True
    return jsonify(
        Msg(
            True,
            gettext(
                'update success, please determine if you need to restart the panel.'
            )))