From dcb4d334efa90367fc247c73be69590b50260143 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Wed, 4 Dec 2013 23:53:36 +0100 Subject: [PATCH] =?utf8?q?Si=20la=20cr=C3=A9ation=20du=20type=20adoc=20n?= =?utf8?q?=E2=80=99est=20pas=20possible=20(pas=20autoris=C3=A9e)=20on=20cr?= =?utf8?q?=C3=A9e=20alors=20un=20fichier=20en=20recours.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Folder.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) -- 2.20.1