[Erp5-report] r38474 nicolas - /erp5/trunk/products/ERP5/Tool/ContributionTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Sep 20 11:02:04 CEST 2010
Author: nicolas
Date: Mon Sep 20 11:02:01 2010
New Revision: 38474
URL: http://svn.erp5.org?rev=38474&view=rev
Log:
Two different variables were used to store the content_type of files,
mime_type and content_type.
Choose only one variable for consistency. This patch avoid loosing
useful informations.
content_type name is preferred because it is the id of property on
ERP5 Documents.
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=38474&r1=38473&r2=38474&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] Mon Sep 20 11:02:01 2010
@@ -142,7 +142,7 @@ class ContributionTool(BaseTool):
document = None
# Try to find the file_name
- mime_type = None
+ content_type = None
if not url:
# check if file was provided
file = kw.get('file', None)
@@ -220,7 +220,7 @@ class ContributionTool(BaseTool):
# Check if same file is already exists. if it exists, then update it.
#
if portal_type is None:
- portal_type = self._guessPortalType(file_name, mime_type, data)
+ portal_type = self._guessPortalType(file_name, content_type, data)
property_dict = self.getMatchedFileNamePatternDict(file_name)
reference = property_dict.get('reference', None)
version = property_dict.get('version', None)
More information about the Erp5-report
mailing list