Treat empty string as null, for app settings field values

This commit is contained in:
Lance Edgar 2019-02-22 15:58:55 -06:00
parent 145e7f5529
commit 4b97b403d3

View file

@ -140,7 +140,7 @@ class AppSettingsView(View):
'name': setting.node_name, 'name': setting.node_name,
'default': self.get_setting_value(setting), 'default': self.get_setting_value(setting),
} }
if kwargs['default'] is None: if kwargs['default'] is None or kwargs['default'] == '':
kwargs['default'] = colander.null kwargs['default'] = colander.null
if not setting.required: if not setting.required:
kwargs['missing'] = colander.null kwargs['missing'] = colander.null