Projet

Général

Profil

0001-workflows-fix-inspect-of-timeout-trigger-with-python.patch

Lauréline Guérin, 09 décembre 2022 10:26

Télécharger (2,29 ko)

Voir les différences:

Subject: [PATCH] workflows: fix inspect of timeout trigger with python
 expression (#72129)

 tests/admin_pages/test_workflow.py | 7 +++++++
 wcs/workflows.py                   | 8 +++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
tests/admin_pages/test_workflow.py
2517 2517
        ('String / Template', False, 'String / Template'),
2518 2518
    ]
2519 2519

  
2520
    # check inspect page with python expression, and python disabled
2521
    trigger.anchor_expression = 'False'
2522
    trigger.anchor = 'python'
2523
    trigger.timeout = 42
2524
    workflow.store()
2525
    app.get('/backoffice/workflows/%s/inspect' % workflow.id)  # no error
2526

  
2520 2527

  
2521 2528
def test_workflows_global_actions_external_workflow_action(pub):
2522 2529
    FormDef.wipe()
wcs/workflows.py
1599 1599
            ('latest-arrival', _('Latest arrival in status')),
1600 1600
            ('finalized', _('Arrival in final status')),
1601 1601
            ('template', _('String / Template')),
1602
            ('python', _('Python expression')),
1602 1603
        ]
1603
        if not get_publisher().has_site_option('disable-python-expressions'):
1604
            options.append(('python', _('Python expression')))
1605 1604
        return collections.OrderedDict(options)
1606 1605

  
1607 1606
    def properly_configured(self):
......
1631 1630

  
1632 1631
    def form(self, workflow):
1633 1632
        form = Form(enctype='multipart/form-data')
1634
        options = list(self.get_anchor_labels().items())
1633
        options = self.get_anchor_labels()
1634
        if get_publisher().has_site_option('disable-python-expressions'):
1635
            options.pop('python')
1636
        options = list(options.items())
1635 1637
        form.add(
1636 1638
            SingleSelectWidget,
1637 1639
            'anchor',
1638
-