Projet

Général

Profil

0003-workflow-ignore-empty-items-on-workflow-import-31823.patch

Nicolas Roche, 29 août 2019 16:43

Télécharger (1,4 ko)

Voir les différences:

Subject: [PATCH 3/4] workflow: ignore empty items on workflow import (#31823)

 tests/test_workflow_import.py | 2 +-
 wcs/workflows.py              | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
tests/test_workflow_import.py
568 568
    st1 = wf.add_status('Status1', 'st1')
569 569

  
570 570
    sendsms = SendSMSWorkflowStatusItem()
571
    sendsms.to = ['0123456789']
571
    sendsms.to = ['0123456789', '']
572 572
    sendsms.body = 'hello'
573 573
    st1.items.append(sendsms)
574 574
    sendsms.parent = st1
wcs/workflows.py
832 832
                continue
833 833
            if list(el):
834 834
                if type(getattr(self, attribute)) is list:
835
                    v = [x.text.encode(charset) for x in el]
835
                    v = [x.text.encode(charset) if x.text is not None else ''
836
                         for x in el]
836 837
                elif type(getattr(self, attribute)) is dict:
837 838
                    v = {}
838 839
                    for e in el:
839
-