[Erp5-report] r15136 - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 4 10:58:18 CEST 2007


Author: vincent
Date: Wed Jul  4 10:58:18 2007
New Revision: 15136

URL: http://svn.erp5.org?rev=15136&view=rev
Log:
Long overdue quick hack to prevent business template system from importing non-xml files. This is consistent with the not-less-quickhack user for object naming which just strips the 4 last characters of the filename, and will fix the case of accidental import of backup files (Foo.xml~) which led to creation of "Foo." objects.

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=15136&r1=15135&r2=15136&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Wed Jul  4 10:58:18 2007
@@ -536,6 +536,9 @@
 
   def _importFile(self, file_name, file):
     # import xml file
+    if not file_name.endswith('.xml'):
+      LOG('Business Template', 0, 'Skipping file "%s"' % (file_name, ))
+      return
     obj = self
     connection = None
     while connection is None:




More information about the Erp5-report mailing list