mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-27 15:54:16 +00:00
Corrected issue with encoding / decoding of dictionary and list type settings values.
Updated zone record settings management to use valid JSON format with backwards compatibility support for the non-JSON literal format.
This commit is contained in:
@@ -72,13 +72,17 @@ class Setting(db.Model):
|
||||
return False
|
||||
|
||||
def set(self, setting, value):
|
||||
import json
|
||||
current_setting = Setting.query.filter(Setting.name == setting).first()
|
||||
|
||||
if current_setting is None:
|
||||
current_setting = Setting(name=setting, value=None)
|
||||
db.session.add(current_setting)
|
||||
|
||||
value = str(AppSettings.convert_type(setting, value))
|
||||
value = AppSettings.convert_type(setting, value)
|
||||
|
||||
if isinstance(value, dict) or isinstance(value, list):
|
||||
value = json.dumps(value)
|
||||
|
||||
try:
|
||||
current_setting.value = value
|
||||
|
Reference in New Issue
Block a user