Projet

Général

Profil

0001-workflows-action-copy-select-current-statusby-defaul.patch

Lauréline Guérin, 30 juin 2022 14:49

Télécharger (1,66 ko)

Voir les différences:

Subject: [PATCH] workflows: action copy, select current statusby default
 (#66476)

 tests/admin_pages/test_workflow.py | 1 +
 wcs/admin/workflows.py             | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
tests/admin_pages/test_workflow.py
479 479

  
480 480
    resp = app.get('/backoffice/workflows/%s/status/%s/' % (workflow.id, st3.id))
481 481
    resp = resp.click('Copy')
482
    assert resp.form['status'].value == 'Status3'
482 483
    resp.form['status'] = 'Status1'
483 484
    resp = resp.form.submit()
484 485
    assert resp.location == 'http://example.net/backoffice/workflows/%s/status/%s/' % (workflow.id, st3.id)
wcs/admin/workflows.py
462 462
        form = Form(enctype='multipart/form-data')
463 463
        destinations = [(x.id, x.name) for x in self.workflow.possible_status]
464 464

  
465
        form.add(SingleSelectWidget, 'status', title=_('Target status'), options=destinations)
465
        form.add(
466
            SingleSelectWidget, 'status', title=_('Target status'), options=destinations, value=self.parent.id
467
        )
466 468

  
467 469
        form.add_submit('copy', _('Copy'))
468 470
        form.add_submit('cancel', _('Cancel'))
469
-