external_workflow: check that field data source exists (#42613)
This commit is contained in:
parent
cc60c873c7
commit
6b69a5a1b6
|
@ -4836,7 +4836,9 @@ def test_call_external_workflow_with_data_sourced_object(pub):
|
|||
formdef.fields = [
|
||||
ItemField(id='0', label='Card',
|
||||
type='item', varname='card',
|
||||
data_source=datasource)
|
||||
data_source=datasource),
|
||||
EmailField(id='1', label='Email',
|
||||
varname='email')
|
||||
]
|
||||
formdef.workflow = wf
|
||||
formdef.store()
|
||||
|
@ -4845,7 +4847,7 @@ def test_call_external_workflow_with_data_sourced_object(pub):
|
|||
assert carddef.data_class().count() == 1
|
||||
|
||||
formdata = formdef.data_class()()
|
||||
formdata.data = {'0': '1'}
|
||||
formdata.data = {'0': '1', '1': 'foo@example.com'}
|
||||
formdata.store()
|
||||
formdata.just_created()
|
||||
formdata.perform_workflow()
|
||||
|
|
|
@ -114,7 +114,7 @@ class ExternalWorkflowGlobalAction(WorkflowStatusItem):
|
|||
data_ids = []
|
||||
# search linked objects in data sources
|
||||
for field in formdata.get_formdef().get_all_fields():
|
||||
if field.data_source and field.data_source['type'] == self.slug:
|
||||
if getattr(field, 'data_source', None) and field.data_source['type'] == self.slug:
|
||||
data_ids.append(formdata.data.get(field.id))
|
||||
|
||||
# search in evolution
|
||||
|
|
Loading…
Reference in New Issue