From 718a98a022db00b4e86e50146a887bc1045fd03e Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 11 Feb 2020 19:16:24 +0100 Subject: [PATCH] create_formdata: change default for draft option (#39638) --- tests/test_backoffice_pages.py | 1 + tests/test_form_pages.py | 1 + wcs/locale/fr/LC_MESSAGES/django.po | 4 ++++ wcs/wf/create_formdata.py | 9 ++++----- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/test_backoffice_pages.py b/tests/test_backoffice_pages.py index 78727344..0a0beaf0 100644 --- a/tests/test_backoffice_pages.py +++ b/tests/test_backoffice_pages.py @@ -5712,6 +5712,7 @@ def create_formdata(pub): create_formdata = CreateFormdataWorkflowStatusItem() create_formdata.id = '_create_formdata' create_formdata.varname = 'resubmitted' + create_formdata.draft = True create_formdata.formdef_slug = target_formdef.url_name create_formdata.keep_user = True create_formdata.backoffice_submission = True diff --git a/tests/test_form_pages.py b/tests/test_form_pages.py index dd7bdb9e..e217ac9d 100644 --- a/tests/test_form_pages.py +++ b/tests/test_form_pages.py @@ -7527,6 +7527,7 @@ def create_formdata(pub): create_formdata = CreateFormdataWorkflowStatusItem() create_formdata.varname = 'resubmitted' + create_formdata.draft = True create_formdata.id = '_create_formdata' create_formdata.formdef_slug = target_formdef.url_name create_formdata.mappings = [ diff --git a/wcs/locale/fr/LC_MESSAGES/django.po b/wcs/locale/fr/LC_MESSAGES/django.po index 178f9ff5..7e45e7f4 100644 --- a/wcs/locale/fr/LC_MESSAGES/django.po +++ b/wcs/locale/fr/LC_MESSAGES/django.po @@ -6853,6 +6853,10 @@ msgstr "Certains champs cibles sont répétés." msgid "New Form Creation" msgstr "Création d’une demande" +#: wf/create_formdata.py:210 +msgid "Create new draft" +msgstr "Créer en tant que brouillon" + #: wf/create_formdata.py:211 msgid "Backoffice submission" msgstr "Saisie backoffice" diff --git a/wcs/wf/create_formdata.py b/wcs/wf/create_formdata.py index 9d0889c3..3bff3509 100644 --- a/wcs/wf/create_formdata.py +++ b/wcs/wf/create_formdata.py @@ -172,7 +172,7 @@ class CreateFormdataWorkflowStatusItem(WorkflowStatusItem): evolution_part_class = LinkedFormdataEvolutionPart formdef_slug = None - draft = True + draft = False backoffice_submission = False keep_user = True keep_submission_context = False @@ -207,9 +207,8 @@ class CreateFormdataWorkflowStatusItem(WorkflowStatusItem): options=list_forms) if 'draft' in parameters: form.add(CheckboxWidget, '%sdraft' % prefix, - title=_('Draft'), - value=self.draft, - advanced=(self.draft == CreateFormdataWorkflowStatusItem.draft)) + title=_('Create new draft'), + value=self.draft) if 'backoffice_submission' in parameters: form.add(CheckboxWidget, '%sbackoffice_submission' % prefix, title=_('Backoffice submission'), @@ -243,7 +242,7 @@ class CreateFormdataWorkflowStatusItem(WorkflowStatusItem): super(CreateFormdataWorkflowStatusItem, self).submit_admin_form(form) def get_parameters(self): - return ('formdef_slug', 'mappings', 'draft', 'backoffice_submission', + return ('draft', 'formdef_slug', 'mappings', 'backoffice_submission', 'keep_user', 'keep_submission_context', 'varname') def perform(self, formdata): -- 2.24.0