workflows: allow building an attachment from strings (#36515)

This commit is contained in:
Frédéric Péters 2019-11-13 14:37:13 +01:00
parent 7071ec96c4
commit ec09c2ea6a
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ from quixote import get_request, get_publisher
from quixote.html import htmltext, TemplateIO
from django.utils import six
from django.utils.encoding import force_text, smart_text
from django.utils.encoding import force_bytes, force_text, smart_text
from django.utils.formats import date_format as django_date_format
from django.utils.html import urlize
from django.utils.six.moves.html_parser import HTMLParser
@ -1008,7 +1008,7 @@ class FileField(WidgetField):
else:
charset = None
upload = PicklableUpload(value['filename'], content_type, charset)
upload.receive([value['content']])
upload.receive([force_bytes(value['content'])])
return upload
raise ValueError('invalid data for file type (%r)' % value)