fix(commands/status): Handle exception when no last_accessed is returned from GoCardless API.

This commit is contained in:
Elisiário Couto
2024-08-21 15:57:44 +01:00
parent a29bd1ab68
commit c70a4e5cb8

View File

@@ -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()