Savesettings command fixes
Don't error out when saving a config if no previous config exists. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -253,7 +253,7 @@ class Setting(object):
|
|||||||
if not cls._config_file_cache:
|
if not cls._config_file_cache:
|
||||||
cls._config_file_cache = read_configuration_file(
|
cls._config_file_cache = read_configuration_file(
|
||||||
filepath=settings.CONFIGURATION_FILEPATH
|
filepath=settings.CONFIGURATION_FILEPATH
|
||||||
)
|
) or {}
|
||||||
return cls._config_file_cache
|
return cls._config_file_cache
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class SettingNamespaceSingleton(object):
|
|||||||
name='CONFIGURATION_FILEPATH'
|
name='CONFIGURATION_FILEPATH'
|
||||||
)
|
)
|
||||||
|
|
||||||
file_data = self.load_config_file(filepath=filepath)
|
file_data = self.load_config_file(filepath=filepath) or {}
|
||||||
self._cache_file_data = file_data
|
self._cache_file_data = file_data
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user