From b1a1d8de3e324e33a5e428559ce0967f6564e73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 2 Feb 2024 15:55:55 +0100 Subject: [PATCH] chore: simplify dictionary getting --- wlc/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wlc/main.py b/wlc/main.py index bd9a851f..57a1b967 100644 --- a/wlc/main.py +++ b/wlc/main.py @@ -269,7 +269,7 @@ def run(self): def check_result(result, message): """Check result json data.""" if not result["result"]: - raise CommandError(message, result["detail"] if "detail" in result else "") + raise CommandError(message, result.get("detail", "")) class ProjectCommand(ObjectCommand): @@ -771,7 +771,7 @@ def run(self): ): raise CommandError( "Failed to upload translations!", - result["detail"] if "detail" in result else "", + result.get("detail", ""), )