Emulate checks on keyword arguments and then return. Validate only should have no side effects so the previous behavior was a bug.

This commit is contained in:
Kelly McDonald 2021-04-28 10:03:52 -04:00
parent 71a63c049d
commit dc6f1cc80d
2 changed files with 8 additions and 2 deletions

View File

@ -10,7 +10,9 @@ class FileDataGet(Script, DataStoreBase):
return """Gets user data from the data store - takes only two keyword arguments arguments: 'file_id' and 'key' """ return """Gets user data from the data store - takes only two keyword arguments arguments: 'file_id' and 'key' """
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs): def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
self.do_task(task, study_id, workflow_id, *args, **kwargs) if self.validate_kw_args(**kwargs):
myargs = [kwargs['key']]
return True
def validate_kw_args(self,**kwargs): def validate_kw_args(self,**kwargs):
if kwargs.get('key',None) is None: if kwargs.get('key',None) is None:

View File

@ -10,7 +10,11 @@ class FileDataSet(Script, DataStoreBase):
return """Sets data the data store - takes three keyword arguments arguments: 'file_id' and 'key' and 'value'""" return """Sets data the data store - takes three keyword arguments arguments: 'file_id' and 'key' and 'value'"""
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs): def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
self.do_task(task, study_id, workflow_id, *args, **kwargs) if self.validate_kw_args(**kwargs):
myargs = [kwargs['key'],kwargs['value']]
fileid = kwargs['file_id']
del(kwargs['file_id'])
return True
def validate_kw_args(self,**kwargs): def validate_kw_args(self,**kwargs):
if kwargs.get('key',None) is None: if kwargs.get('key',None) is None: