[Erp5-report] r34888 nicolas - /erp5/trunk/products/ERP5/Tool/ContributionTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 30 13:03:31 CEST 2010


Author: nicolas
Date: Fri Apr 30 13:03:31 2010
New Revision: 34888

URL: http://svn.erp5.org?rev=34888&view=rev
Log:
Move the return BaiseTool.newContent for temporary objects later in order
to initialise some variables like portal_type and filename to ease
the creation of temporary object. Without this patch, the first portal_type
of allowed_content_type of portal_contribution is used.


Modified:
    erp5/trunk/products/ERP5/Tool/ContributionTool.py

Modified: erp5/trunk/products/ERP5/Tool/ContributionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/ContributionTool.py?rev=34888&r1=34887&r2=34888&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] Fri Apr 30 13:03:31 2010
@@ -135,10 +135,6 @@
       # we can pass file as parameter to ZPublisher
       # whenever we ingest email
       kw['data'] = data
-    # Temp objects use the standard newContent from Folder
-    if temp_object:
-      # For temp_object creation, use the standard method
-      return BaseTool.newContent(self, id=id, portal_type=portal_type, temp_object=1, **kw)
 
     document = None
 
@@ -225,6 +221,11 @@
             raise Unauthorized, "[DMS] You are not allowed to update the existing document which has the same coordinates (id %s)" % document.getId()
           document.edit(file=kw['file'])
           return document
+
+    # Temp objects use the standard newContent from Folder
+    if temp_object:
+      # For temp_object creation, use the standard method
+      return BaseTool.newContent(self, id=id, portal_type=portal_type, temp_object=1, **kw)
 
     # Then put the file inside ourselves for a short while
     if container_path is not None:




More information about the Erp5-report mailing list