forms: do not include draft recall block in preview mode (#59816)
This commit is contained in:
parent
ababab88e0
commit
3977675ee0
|
@ -2720,6 +2720,16 @@ def test_preview_form(pub):
|
|||
assert 'This was only a preview: form was not actually submitted.' in next_page.text
|
||||
assert len([x for x in formdef.data_class().select() if not x.is_draft()]) == 0
|
||||
|
||||
# check no drafts are proposed for recall
|
||||
formdef.data_class().wipe()
|
||||
draft = formdef.data_class()()
|
||||
draft.user_id = user.id
|
||||
draft.status = 'draft'
|
||||
draft.data = {}
|
||||
draft.store()
|
||||
resp = login(get_app(pub), username='foo', password='foo').get('/preview/test/')
|
||||
assert 'You already started to fill this form.' not in resp.text
|
||||
|
||||
|
||||
def test_form_item_data_source_field_submit(pub):
|
||||
def submit_item_data_source_field(ds):
|
||||
|
|
|
@ -24,6 +24,7 @@ from .root import FormPage
|
|||
|
||||
class PreviewFormPage(FormPage):
|
||||
_q_exports = ['', 'tempfile', 'live']
|
||||
preview_mode = True
|
||||
|
||||
def check_role(self):
|
||||
pass
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
{% block form-main %}
|
||||
{% block drafts-recall %}
|
||||
{% if view.initial_drafts %}
|
||||
{% if not view.preview_mode and view.initial_drafts %}
|
||||
{% with view.initial_drafts|length as drafts_length %}
|
||||
<div class="drafts-recall">
|
||||
<p>
|
||||
|
|
Loading…
Reference in New Issue