X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/326a6677709320dc5149de76f6ae2bdea31fe4fa..c1ce0412563763e2afff6b023d934b9db389fea6:/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)