projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9cf1680
)
Enregistrement du nom original du fichier dans « orig_name ». Écrasement de l'objet...
author
Benoît Pin
<pin@cri.ensmp.fr>
Mon, 22 Jul 2013 13:47:22 +0000
(15:47 +0200)
committer
Benoît Pin
<pin@cri.ensmp.fr>
Mon, 22 Jul 2013 13:47:22 +0000
(15:47 +0200)
Folder.py
patch
|
blob
|
history
diff --git
a/Folder.py
b/Folder.py
index
ce440f1
..
c3ca6f7
100644
(file)
--- a/
Folder.py
+++ b/
Folder.py
@@
-321,7
+321,12
@@
class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) :
if typ is None:
typ, enc=guess_content_type(validId, body)
if typ is None:
typ, enc=guess_content_type(validId, body)
- ob = self.PUT_factory(validId, typ, body)
+ if self.checkIdAvailable(validId) :
+ ob = self.PUT_factory(validId, typ, body)
+ self._setObject(validId, ob)
+ ob = self._getOb(validId)
+ else :
+ ob = self._getOb(validId)
# We call _verifyObjectPaste with verify_src=0, to see if the
# user can create this type of object (and we don't need to
# We call _verifyObjectPaste with verify_src=0, to see if the
# user can create this type of object (and we don't need to
@@
-333,11
+338,8
@@
class PlinnFolder(CMFCatalogAware, PortalFolder, DefaultDublinCoreImpl) :
(ob.__class__, repr(self), sys.exc_info()[1],)
raise Unauthorized, sMsg
(ob.__class__, repr(self), sys.exc_info()[1],)
raise Unauthorized, sMsg
- # Delegate actual PUT handling to the new object,
- # SDS: But just *after* it has been stored.
- self._setObject(validId, ob)
- ob = self._getOb(validId)
ob.PUT(REQUEST, RESPONSE)
ob.PUT(REQUEST, RESPONSE)
+ ob.orig_name = fileName
RESPONSE.setStatus(201)
RESPONSE.setBody('')
RESPONSE.setStatus(201)
RESPONSE.setBody('')