Projet

Général

Profil

0001-backoffice-always-display-submission-sidebar-if-asso.patch

Frédéric Péters, 03 août 2020 22:18

Télécharger (1,76 ko)

Voir les différences:

Subject: [PATCH] backoffice: always display submission sidebar if associated
 user is set (#45712)

 tests/test_backoffice_pages.py | 4 ++++
 wcs/backoffice/submission.py   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
tests/test_backoffice_pages.py
3364 3364
    resp = resp.follow()  # redirect to created draft
3365 3365
    resp = resp.follow()  # redirect to ?mt=
3366 3366

  
3367
    # check user is mentioned in sidebar
3368
    assert '<h3>Associated User</h3>' in resp
3369
    assert '<p>%s</p>' % local_user.get_display_name() in resp
3370

  
3367 3371
    assert resp.form['f1'].value == local_user.email  # prefill with form_user_email
3368 3372
    resp.form['f2'] = 'baz'
3369 3373
    resp.form['f3'] = 'C'
wcs/backoffice/submission.py
187 187
                r += htmltext('<p>-</p>')
188 188

  
189 189
        welco_url = get_publisher().get_site_option('welco_url', 'options')
190
        if formdata and formdata.submission_context:
190
        if formdata and (formdata.submission_context or formdata.user_id):
191 191
            from .management import FormBackOfficeStatusPage
192 192
            r += FormBackOfficeStatusPage(self.formdef, formdata).get_extra_context_bar()
193 193
        elif not welco_url and not self.edit_mode:
194
-