diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index 101929d4..a76553ce 100644 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -739,10 +739,7 @@ class WorkflowService(object): if hasattr(task.task_spec, 'form'): for field in task.task_spec.form.fields: - if field.has_property(Task.FIELD_PROP_READ_ONLY) and \ - field.get_property(Task.FIELD_PROP_READ_ONLY).lower().strip() == "true": - continue # Don't add read-only data - elif field.has_property(Task.FIELD_PROP_REPEAT): + if field.has_property(Task.FIELD_PROP_REPEAT): group = field.get_property(Task.FIELD_PROP_REPEAT) if group in latest_data: data[group] = latest_data[group] diff --git a/tests/data/read_only_field/read_only_field.bpmn b/tests/data/read_only_field/read_only_field.bpmn new file mode 100644 index 00000000..3620afdf --- /dev/null +++ b/tests/data/read_only_field/read_only_field.bpmn @@ -0,0 +1,77 @@ + + + + + Flow_0to8etb + + + + + + Flow_0a95kns + + + + Flow_0to8etb + Flow_04r75ca + string_value = 'asdf' + + + + + + + + + + + + + Flow_04r75ca + Flow_0g25v76 + + + Read only is {{ read_only_field }} + Flow_0g25v76 + Flow_0a95kns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/workflow/test_workflow_read_only_field.py b/tests/workflow/test_workflow_read_only_field.py new file mode 100644 index 00000000..804650d8 --- /dev/null +++ b/tests/workflow/test_workflow_read_only_field.py @@ -0,0 +1,16 @@ +from tests.base_test import BaseTest + + +class TestReadOnlyField(BaseTest): + + def test_read_only(self): + + workflow = self.create_workflow('read_only_field') + workflow_api = self.get_workflow_api(workflow) + first_task = workflow_api.next_task + read_only_field = first_task.data['read_only_field'] + self.complete_form(workflow, first_task, {'read_only_field': read_only_field}) + workflow_api = self.get_workflow_api(workflow) + task = workflow_api.next_task + + self.assertEqual('Read only is asdf', task.documentation) \ No newline at end of file