Backport configuration file improvements

Remove support for quoted entried. Support unquoted entries. Support
custom location for the config files.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-07-09 15:40:20 -04:00
parent 7faa24eb7b
commit 9564db398f
26 changed files with 258 additions and 296 deletions
-12
View File
@@ -25,18 +25,6 @@ class SettingForm(forms.Form):
self.fields['value'].initial = self.setting.serialized_value
def clean(self):
quotes = ['"', "'"]
if self.setting.quoted:
stripped = self.cleaned_data['value'].strip()
if stripped[0] not in quotes or stripped[-1] not in quotes:
raise ValidationError(
_(
'Value must be properly quoted.'
)
)
try:
yaml.load(stream=self.cleaned_data['value'], Loader=SafeLoader)
except yaml.YAMLError: