Puts data from sequential calls to StudyInfo into the right place. Sets the required document flag correctly.
This commit is contained in:
parent
d91f690388
commit
47de010a88
|
@ -54,7 +54,11 @@ class Script(object):
|
|||
return all_subclasses
|
||||
|
||||
def add_data_to_task(self, task, data):
|
||||
task.data[self.__class__.__name__] = data
|
||||
key = self.__class__.__name__
|
||||
if key in task.data:
|
||||
task.data[key].update(data)
|
||||
else:
|
||||
task.data[key] = data
|
||||
|
||||
class ScriptValidationError:
|
||||
|
||||
|
|
|
@ -95,8 +95,6 @@ class StudyInfo(Script):
|
|||
if cmd == 'documents_status':
|
||||
self.add_data_to_task(task, {cmd: StudyService().get_documents_status(study_id)})
|
||||
|
||||
task.data["study"] = study_info
|
||||
|
||||
|
||||
def check_args(self, args):
|
||||
if len(args) != 1 or (args[0] not in StudyInfo.type_options):
|
||||
|
|
|
@ -94,7 +94,7 @@ class StudyService(object):
|
|||
doc_service = Documents()
|
||||
|
||||
# Get PB required docs
|
||||
pb_docs = ProtocolBuilderService.get_required_docs(study_id)
|
||||
pb_docs = ProtocolBuilderService.get_required_docs(study_id=study_id, as_objects=True)
|
||||
|
||||
# Get required docs for study
|
||||
study_docs = doc_service.get_documents(study_id=study_id, pb_docs=pb_docs)
|
||||
|
|
|
@ -15,15 +15,15 @@
|
|||
|:-------------- |:-------- |:------ |
|
||||
{% for approval in StudyInfo.approvals -%}
|
||||
| [{{approval.display_name}}](/workflow/{{approval.id}}) | {{approval.status}} | [Context here](/help/{{approval.workflow_spec_id}}) |
|
||||
{% endfor -%}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
## Documents
|
||||
| Code | Status | Help |
|
||||
|:-------------- |:-------- |:------ |
|
||||
{% for doc in study.documents_status -%}
|
||||
{% for doc in StudyInfo.documents_status -%}
|
||||
| [{{doc.code}}](/study/{{doc.study_id}}/workflow/{{doc.workflow_id}}) | {{doc.status}} | [Context here](/help/{{doc.workflow_spec_id}}) |
|
||||
{% endfor -%}
|
||||
{% endfor %}
|
||||
</bpmn:documentation>
|
||||
<bpmn:extensionElements>
|
||||
<camunda:properties>
|
||||
|
|
Loading…
Reference in New Issue