Projet

Général

Profil

0001-workflows-log-status-item-on-external-workflow-actio.patch

Thomas Noël, 31 juillet 2020 11:32

Télécharger (2,09 ko)

Voir les différences:

Subject: [PATCH] workflows: log status item on external workflow action error
 (#45652)

 tests/test_workflows.py     | 1 +
 wcs/wf/external_workflow.py | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
tests/test_workflows.py
4888 4888
    logged_error = LoggedError.select()[0]
4889 4889
    assert logged_error.summary == 'Could not find linked "External Form" object by id %s' % external_formdata.id
4890 4890
    assert logged_error.exception_class == 'KeyError'
4891
    assert logged_error.status_item_id == action.id
4891 4892

  
4892 4893

  
4893 4894
def test_call_external_workflow_with_data_sourced_object(pub):
wcs/wf/external_workflow.py
142 142
                # use custom error message depending on target type
143 143
                LoggedError.record(_('Could not find linked "%(object_name)s" object by id %(object_id)s') % {
144 144
                    'object_name': objectdef.name, 'object_id': target_id},
145
                    formdata=formdata, exception=e)
145
                    formdata=formdata, status_item=self, exception=e)
146 146

  
147 147
    def get_parameters(self):
148 148
        return ('slug', 'trigger_id', 'condition')
......
154 154

  
155 155
        trigger = self.get_trigger(objectdef.workflow)
156 156
        if not trigger:
157
            LoggedError.record(_('No trigger with id "%s" found in workflow') % self.trigger_id)
157
            LoggedError.record(_('No trigger with id "%s" found in workflow') % self.trigger_id,
158
                    formdata=formdata, status_item=self)
158 159
            return
159 160

  
160 161
        class CallerSource:
161
-