From b90218580d5f419b02408f0f24ced0e0a0c5a5e9 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Wed, 8 Nov 2023 14:21:26 +0000 Subject: [PATCH] dev: update instance configuration load --- apiserver/bin/instance_configuration.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apiserver/bin/instance_configuration.py b/apiserver/bin/instance_configuration.py index 806a391ec..b30875057 100644 --- a/apiserver/bin/instance_configuration.py +++ b/apiserver/bin/instance_configuration.py @@ -36,11 +36,13 @@ def load_config(): } for key, value in config_keys.items(): - obj, created = InstanceConfiguration.objects.update_or_create( - key=key, value=value + obj, created = InstanceConfiguration.objects.get_or_create( + key=key ) - action = "Created" if created else "Updated" - print(f"{action} {key} with value from environment variable.") + obj.value = value + obj.save() + + print(f"{key} loaded with value from environment variable.") if __name__ == "__main__":