From: Benoît Pin Date: Wed, 4 Dec 2013 22:53:36 +0000 (+0100) Subject: Si la création du type adoc n’est pas possible (pas autorisée) on crée alors un fichi... X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/commitdiff_plain/dcb4d334efa90367fc247c73be69590b50260143?hp=522ae82bd3a30e30ed50c444fd93164479a8e051 Si la création du type adoc n’est pas possible (pas autorisée) on crée alors un fichier en recours. --- 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)