mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-22 12:48:25 +00:00
22 lines
718 B
Python
22 lines
718 B
Python
from SpiffWorkflow.util.metrics import timeit
|
|
|
|
from crc.scripts.script import Script
|
|
from crc.services.user_file_service import UserFileService
|
|
|
|
|
|
class IsFileUploaded(Script):
|
|
|
|
def get_description(self):
|
|
return """Test whether a file is uploaded for a study.
|
|
Pass in the IRB Doc Code for the file."""
|
|
|
|
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
|
|
doc_code = args[0]
|
|
files = UserFileService.get_files_for_study(study_id)
|
|
|
|
def do_task(self, task, study_id, workflow_id, *args, **kwargs):
|
|
|
|
doc_code = args[0]
|
|
files = UserFileService.get_files_for_study(study_id, irb_doc_code=doc_code)
|
|
return len(files) > 0
|