[Erp5-report] r41125 nicolas - /erp5/trunk/products/ERP5/Tool/ContributionTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sat Dec 4 16:08:02 CET 2010
Author: nicolas
Date: Sat Dec 4 16:08:02 2010
New Revision: 41125
URL: http://svn.erp5.org?rev=41125&view=rev
Log:
If no content_type was not reading from file, guess it from filename value.
It will help portal_contribution_registry to provide better results
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=41125&r1=41124&r2=41125&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] Sat Dec 4 16:08:02 2010
@@ -182,6 +182,11 @@ class ContributionTool(BaseTool):
kw['content_type'] = content_type
kw['file'] = file_object
+ if not content_type:
+ # fallback to a default content_type according provided
+ # filename
+ content_type = self.guessMimeTypeFromFilename(filename)
+
# If the portal_type was provided, we can go faster
if portal_type and container is None:
# We know the portal_type, let us find the default module
More information about the Erp5-report
mailing list