Commit a8ad0274 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

do not raise an exception if a module for old object is already removed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32884 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7db1e36c
......@@ -786,9 +786,12 @@ class ObjectTemplateItem(BaseTemplateItem):
new_io = StringIO()
old_io = StringIO()
OFS.XMLExportImport.exportXML(new_object._p_jar, new_object._p_oid, new_io)
OFS.XMLExportImport.exportXML(old_object._p_jar, old_object._p_oid, old_io)
new_obj_xml = new_io.getvalue()
try:
OFS.XMLExportImport.exportXML(old_object._p_jar, old_object._p_oid, old_io)
old_obj_xml = old_io.getvalue()
except ImportError, e: # module is already removed etc.
old_obj_xml = '(%s: %s)' % (e.__class__.__name__, e)
new_io.close()
old_io.close()
if new_obj_xml != old_obj_xml:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment