From c70a4e5cb87a19a5a0ed194838e323c6246856ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elisi=C3=A1rio=20Couto?= Date: Wed, 21 Aug 2024 15:57:44 +0100 Subject: [PATCH] fix(commands/status): Handle exception when no `last_accessed` is returned from GoCardless API. --- leggen/commands/status.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/leggen/commands/status.py b/leggen/commands/status.py index 998727c..cb76951 100644 --- a/leggen/commands/status.py +++ b/leggen/commands/status.py @@ -39,7 +39,11 @@ def status(ctx: click.Context): "Status": details["status"], "IBAN": details.get("iban", "N/A"), "Created at": datefmt(details["created"]), - "Last accessed at": datefmt(details["last_accessed"]), + "Last accessed at": ( + datefmt(details["last_accessed"]) + if details.get("last_accessed") + else "N/A" + ), } ) echo()