Island: Fix broken config update statements

This commit is contained in:
vakaris_zilius 2022-06-09 09:35:04 +00:00 committed by vakarisz
parent dabc3cb004
commit 8621c5ddb9
1 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ class ConfigService:
@staticmethod
def set_config_value(config_key_as_arr, value):
mongo_key = ".".join(config_key_as_arr)
mongo.db.config.find_one().update({"$set": {mongo_key: value}})
mongo.db.config.update({}, {"$set": {mongo_key: value}})
@staticmethod
def get_flat_config(should_decrypt=True):
@ -151,7 +151,7 @@ class ConfigService:
item_value = encrypt_dict(SENSITIVE_SSH_KEY_FIELDS, item_value)
else:
item_value = get_datastore_encryptor().encrypt(item_value)
mongo.db.config.find_one().update({"$addToSet": {item_key: item_value}}, upsert=False)
mongo.db.config.update({}, {"$addToSet": {item_key: item_value}})
@staticmethod
def creds_add_username(username):