Changed do_task_validate_only so it returns a mocked value, instead of True/False.

True/False caused problems for workflow validations
This commit is contained in:
mike cullerton 2021-06-04 11:44:55 -04:00
parent ef7ee284b2
commit a3a485dd34
1 changed files with 6 additions and 8 deletions

View File

@ -16,16 +16,14 @@ example : get_study_associate('sbp3ey') => {'uid':'sbp3ey','role':'Unicorn Herde
"""
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
if len(args)<1:
return False
return True
if len(args) < 1:
raise ApiError('no_user_id_specified', 'A uva uid is the sole argument to this function')
return {'uid': 'sbp3ey', 'role': 'Unicorn Herder', 'send_email': False, 'access': True}
def do_task(self, task, study_id, workflow_id, *args, **kwargs):
if len(args)<1:
if len(args) < 1:
raise ApiError('no_user_id_specified', 'A uva uid is the sole argument to this function')
if not isinstance(args[0],type('')):
if not isinstance(args[0], str):
raise ApiError('argument_should_be_string', 'A uva uid is always a string, please check type')
return StudyService.get_study_associate(study_id=study_id,uid=args[0])
return StudyService.get_study_associate(study_id=study_id, uid=args[0])