From e218f27e2473fa2ed4b94c40e78d72005d94fe11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Mo=C5=84ka?= Date: Wed, 13 May 2026 14:33:55 +0200 Subject: [PATCH] Add Optima API datasource template and status handling Add the WebArm Comarch Optima API built-in datasource template and cover its parsed metadata in datasource tests. Keep known-engine status handling ahead of the generic empty-fields fallback so known engines report saved or incomplete correctly. --- anton/commands/datasource/manage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/anton/commands/datasource/manage.py b/anton/commands/datasource/manage.py index ed8e8c0a..f19b0aa1 100644 --- a/anton/commands/datasource/manage.py +++ b/anton/commands/datasource/manage.py @@ -38,12 +38,12 @@ def handle_list_data_sources(console: "Console", vault: DataVault | None = None) source = engine_def.display_name if engine_def else c["engine"] fields = vault.load(c["engine"], c["name"]) or {} - if not fields: - status = "[yellow]incomplete[/]" - elif engine_def and engine_def.auth_method != "choice": + if engine_def and engine_def.auth_method != "choice": required = [f.name for f in engine_def.fields if f.required] missing = [name for name in required if name not in fields] status = "[yellow]incomplete[/]" if missing else "[green]saved[/]" + elif not fields: + status = "[yellow]incomplete[/]" else: status = "[green]saved[/]"