projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
522ae82
)
Si la création du type adoc n’est pas possible (pas autorisée) on crée alors un fichi...
author
Benoît Pin
<benoit.pin@gmail.com>
Wed, 4 Dec 2013 22:53:36 +0000
(23:53 +0100)
committer
Benoît Pin
<benoit.pin@gmail.com>
Wed, 4 Dec 2013 22:53:36 +0000
(23:53 +0100)
Folder.py
patch
|
blob
|
history
diff --git
a/Folder.py
b/Folder.py
index
8691fcf
..
05b7129
100644
(file)
--- 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) :
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)
if IDublinCore.providedBy(ob) :
ob.editMetadata(title=fileName,
format=typ)