From 791328d520ee657d68ca3c3e1f19847ca6b42a90 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Fri, 3 Dec 2021 12:18:17 -0500 Subject: [PATCH] Don't need to ask the question twice --- crc/scripts/set_study_status.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crc/scripts/set_study_status.py b/crc/scripts/set_study_status.py index 7cfbb227..32397d0c 100644 --- a/crc/scripts/set_study_status.py +++ b/crc/scripts/set_study_status.py @@ -12,11 +12,10 @@ class SetStudyStatus(Script): def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs): - new_status = None - if 'status' in kwargs.keys() or len(args) > 0: - if 'status' in kwargs.keys(): - new_status = kwargs['status'] - elif len(args) > 0: + if 'new_status' in kwargs.keys() or len(args) > 0: + if 'new_status' in kwargs.keys(): + new_status = kwargs['new_status'] + else: new_status = args[0] try: @@ -37,11 +36,10 @@ class SetStudyStatus(Script): def do_task(self, task, study_id, workflow_id, *args, **kwargs): # Get new status - new_status = None - if 'status' in kwargs.keys() or len(args) > 0: + if 'new_status' in kwargs.keys() or len(args) > 0: if 'new_status' in kwargs.keys(): new_status = kwargs['new_status'] - elif len(args) > 0: + else: new_status = args[0] # Get StudyStatus object for new_status