Skip to content

Commit

Permalink
Dexterity image builder requires a NamedImage
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Vergés committed May 2, 2017
1 parent 4b96628 commit e3bef59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ftw/builder/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


if HAVE_BLOBS:
from plone.namedfile.file import NamedImage
from plone.namedfile.file import NamedBlobFile as NamedFile
else:
from plone.namedfile.file import NamedFile
Expand Down Expand Up @@ -109,6 +110,10 @@ def attach(self, file_):
self.arguments['file'] = file_
return self

def _attach_dx_file(self, content, name):
self.attach(NamedImage(data=content, filename=name))
return self


class ATImageBuilder(ImageBuilderMixin, ArchetypesBuilder):
pass
Expand Down

0 comments on commit e3bef59

Please sign in to comment.