X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/522ae82bd3a30e30ed50c444fd93164479a8e051..dcb4d334efa90367fc247c73be69590b50260143:/Folder.py diff --git a/Folder.py b/Folder.py index 8691fcf..05b7129 100644 --- a/Folder.py +++ b/Folder.py @@ -323,9 +323,13 @@ class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) : typ, enc=guess_content_type(validId, body) if self.checkIdAvailable(validId) : - ob = self.PUT_factory(validId, typ, body) - self._setObject(validId, ob) - ob = self._getOb(validId) + try : + ob = self.PUT_factory(validId, typ, body) + self._setObject(validId, ob) + ob = self._getOb(validId) + except ValueError : # maybe "Disallowed subobject type". Fallback to file type. + validId = self.invokeFactory('File', validId) + ob = self._getOb(validId) if IDublinCore.providedBy(ob) : ob.editMetadata(title=fileName, format=typ)