From b91e078e22918fe40ac2b798c14ade8f3a718ea2 Mon Sep 17 00:00:00 2001 From: irl Date: Fri, 29 Nov 2024 15:36:50 +0000 Subject: [PATCH] fix: initialise new terraform state to avoid NOT NULL constraint violation --- app/tfstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/tfstate.py b/app/tfstate.py index 152e4e1..5c657f5 100644 --- a/app/tfstate.py +++ b/app/tfstate.py @@ -42,7 +42,7 @@ def handle_update(key: str) -> ResponseReturnValue: def handle_lock(key: str) -> ResponseReturnValue: state = TerraformState.query.filter(TerraformState.key == key).with_for_update().first() if state is None: - state = TerraformState(key=key) + state = TerraformState(key=key, state="") db.session.add(state) if state.lock is not None: lock = state.lock