Skip to content

Commit

Permalink
chore: simplify dictionary getting
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Feb 2, 2024
1 parent 8061b5b commit b1a1d8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wlc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -771,7 +771,7 @@ def run(self):
):
raise CommandError(
"Failed to upload translations!",
result["detail"] if "detail" in result else "",
result.get("detail", ""),
)


Expand Down

0 comments on commit b1a1d8d

Please sign in to comment.