workflows: don't fail on unconfigured export to model action (#34365)

This commit is contained in:
Frédéric Péters 2021-04-18 09:21:10 +02:00
parent 591cb8aa2e
commit e407a3c8af
1 changed files with 2 additions and 1 deletions

View File

@ -484,7 +484,6 @@ class ExportToModel(WorkflowStatusItem):
directory_name = property(get_directory_name)
def apply_template_to_formdata(self, formdata):
assert self.model_file
kind = self.model_file_validation(self.model_file)
if kind == 'rtf':
outstream = self.apply_rtf_template_to_formdata(formdata)
@ -733,6 +732,8 @@ class ExportToModel(WorkflowStatusItem):
self.perform_real(formdata, formdata.evolution[-1])
def perform_real(self, formdata, evo):
if not self.model_file:
return
outstream = self.apply_template_to_formdata(formdata)
filename = self.get_filename()
content_type = self.model_file.content_type