mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
Added config initialization on config command
This commit is contained in:
parent
e11867a55e
commit
9335c73003
@ -198,8 +198,9 @@ class Config(object):
|
||||
cfg.value = value
|
||||
cfg.save()
|
||||
logger.debug('Updated value for {0}.{1} to {2}'.format(section, key, value))
|
||||
return True
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
class GlobalConfig(object):
|
||||
|
@ -55,6 +55,7 @@ class Command(BaseCommand):
|
||||
mod, name = first
|
||||
else:
|
||||
mod, name = GLOBAL_SECTION, first[0]
|
||||
Config.update(mod, name, value)
|
||||
if Config.update(mod, name, value) is False: # If not exists, try to store value without any special parameters
|
||||
Config.section(mod).value(name, value).get()
|
||||
except Exception:
|
||||
logger.exception("Error")
|
||||
|
Loading…
Reference in New Issue
Block a user