Projet

Général

Profil

0001-workflows-consider-redirect-URL-over-remove-abort-UR.patch

Frédéric Péters, 05 octobre 2021 15:37

Télécharger (1,7 ko)

Voir les différences:

Subject: [PATCH] workflows: consider redirect URL over remove/abort URL
 (#57573)

 tests/workflow/test_all.py | 14 ++++++++++++++
 wcs/workflows.py           |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)
tests/workflow/test_all.py
1028 1028
    assert emails.count() == 1
1029 1029
    assert url == 'http://example.net'
1030 1030

  
1031
    # check the url from a redirect action is used
1032
    redirect = RedirectToUrlWorkflowStatusItem()
1033
    redirect.url = 'https://www.example.net/custom-redirect'
1034
    st1.items.insert(0, redirect)
1035
    redirect.parent = st1
1036
    workflow.store()
1037

  
1038
    formdata = formdef.data_class()()
1039
    formdata.just_created()
1040
    formdata.store()
1041
    url = perform_items(st1.items, formdata)
1042
    get_response().process_after_jobs()
1043
    assert url == redirect.url
1044

  
1031 1045

  
1032 1046
def test_register_comment(pub):
1033 1047
    pub.substitutions.feed(MockSubstitutionVariables())
wcs/workflows.py
85 85
        try:
86 86
            url = item.perform(formdata) or url
87 87
        except AbortActionException as e:
88
            url = e.url or url
88
            url = url or e.url
89 89
            break
90 90
        if formdata.status != old_status:
91 91
            break
92
-