mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 13:18:35 +00:00
18 lines
587 B
Python
18 lines
587 B
Python
from crc.api.common import ApiError
|
|
from crc.scripts.script import Script
|
|
|
|
|
|
class DeleteVariables(Script):
|
|
|
|
def get_description(self):
|
|
return """Script to delete variables from task_data, if they exist.
|
|
Accepts a list of variables to delete."""
|
|
|
|
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
|
|
return self.do_task(task, study_id, workflow_id, *args, **kwargs)
|
|
|
|
def do_task(self, task, study_id, workflow_id, *args, **kwargs):
|
|
for arg in args:
|
|
if arg in task.data:
|
|
del(task.data[arg])
|