From 7eef27ddf5d780d7a53191c14ae7b8025a0db0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 30 Sep 2020 13:45:02 +0200 Subject: [PATCH] workflows: don't crash using existing file attachment actions (#47174) --- wcs/wf/attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcs/wf/attachment.py b/wcs/wf/attachment.py index 2151ce5c1..0d80f6610 100644 --- a/wcs/wf/attachment.py +++ b/wcs/wf/attachment.py @@ -114,7 +114,7 @@ class AddAttachmentWorkflowStatusItem(WorkflowStatusItem): title = self.title or _('Upload File') else: title = None - file_type = self.document_type.get('mimetypes') + file_type = (self.document_type or {}).get('mimetypes') form.add(FileWithPreviewWidget, 'attachment%s' % self.id, title=title, required=self.required, hint=self.hint, file_type=file_type, max_file_size=self.max_file_size)