misc: clean assignment when turning export to model non interactive (#72686)

This commit is contained in:
Frédéric Péters 2023-01-16 14:54:18 +01:00 committed by Gitea
parent a0ba54a52c
commit 5da7ee34d5
2 changed files with 11 additions and 0 deletions

View File

@ -1914,6 +1914,12 @@ def test_workflows_export_to_model_action_display(pub):
resp = app.get('/backoffice/workflows/1/status/1/')
assert 'Document Creation (with model named test.rtf of 45.6 KB)' in resp
resp = app.get(export_to.get_admin_url())
resp.form['method'] = 'Non interactive'
resp = resp.form.submit('submit')
workflow.refresh_from_storage()
assert not workflow.possible_status[0].items[0].by
def test_workflows_variables_with_export_to_model_action(pub):
test_workflows_variables(pub)

View File

@ -515,6 +515,11 @@ class ExportToModel(WorkflowStatusItem):
value=self.filename,
)
def submit_admin_form(self, form):
super().submit_admin_form(form)
if not form.has_errors() and not self.is_interactive():
self.by = []
def get_model_file_parameter_view_value(self):
return htmltext('<a href="status/%s/items/%s/?file=model_file">%s</a>') % (
self.parent.id,