From cdfe3037b87694fbe2ad42a7c48750c171117ada Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 28 Jan 2020 13:26:32 -0800 Subject: [PATCH] Fix ternary --- amanuensis/cli/helpers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/amanuensis/cli/helpers.py b/amanuensis/cli/helpers.py index 83230da..5bcf4fe 100644 --- a/amanuensis/cli/helpers.py +++ b/amanuensis/cli/helpers.py @@ -67,9 +67,9 @@ def requires_lexicon(command): return None # Verify lexicon argument in execute pass - val = ((hasattr(cmd_args, 'lexicon') - and getattr(cmd_args, 'lexicon')) - or None) + val = (getattr(cmd_args, 'lexicon') + if hasattr(cmd_args, 'lexicon') + else None) if not val: from amanuensis.config import logger logger.error("This command requires specifying a lexicon") @@ -107,9 +107,9 @@ def requires_user(command): return None # Verify user argument in execute pass - val = ((hasattr(cmd_args, "user") - and getattr(cmd_args, "user")) - or None) + val = (getattr(cmd_args, "user") + if hasattr(cmd_args, "user") + else None) if not val: from amanuensis.config import logger logger.error("This command requires specifying a user")