cards: do not display user pending forms (#50629)

This commit is contained in:
Lauréline Guérin 2021-02-04 12:04:54 +01:00
parent 69bd6d3d2c
commit cae9f3954f
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 7 additions and 1 deletions

View File

@ -634,6 +634,7 @@ def test_carddata_edit_user_selection(pub):
resp = resp.form.submit('button_editable')
resp = resp.follow()
assert 'Associated User' not in resp
assert '/user-pending-forms' not in resp.text
carddef.user_support = 'optional'
carddef.store()
@ -648,3 +649,4 @@ def test_carddata_edit_user_selection(pub):
resp = resp.follow()
assert 'Associated User' in resp
assert carddef.data_class().get(carddata.id).user_id == str(user.id)
assert '/user-pending-forms' not in resp.text

View File

@ -2802,7 +2802,11 @@ class FormBackOfficeStatusPage(FormStatusPage):
if formdata.formdef.lateral_template:
r += htmltext('<div data-async-url="%slateral-block"></div>' % formdata.get_url(backoffice=True))
if formdata.user_id and get_publisher().is_using_postgresql():
if (
not isinstance(formdata.formdef, CardDef)
and formdata.user_id
and get_publisher().is_using_postgresql()
):
r += htmltext(
'<div data-async-url="%suser-pending-forms"></div>' % formdata.get_url(backoffice=True)
)