Commit 805a82e3 authored by Ivan Tyagov's avatar Ivan Tyagov

Try to convert only if not already converted.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29850 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f56fc0b9
...@@ -59,25 +59,28 @@ from xmlrpclib import Fault\n ...@@ -59,25 +59,28 @@ from xmlrpclib import Fault\n
from socket import error as SocketError\n from socket import error as SocketError\n
\n \n
message = None\n message = None\n
try:\n if context.getExternalProcessingState()!=\'converted\':\n
# try to convert to base format only if not already done\n
try:\n
return context.convertToBaseFormat()\n return context.convertToBaseFormat()\n
except ConflictError:\n except ConflictError:\n
raise\n raise\n
except ConversionError, e:\n except ConversionError, e:\n
message = \'Conversion Error: %s\' % (str(e) or \'undefined.\')\n message = \'Conversion Error: %s\' % (str(e) or \'undefined.\')\n
except Fault, e:\n except Fault, e:\n
message = \'XMLFault: %s\' % (repr(e) or \'undefined.\')\n message = \'XMLFault: %s\' % (repr(e) or \'undefined.\')\n
except SocketError, e:\n except SocketError, e:\n
message = \'Socket Error: %s\' % (repr(e) or \'undefined.\')\n message = \'Socket Error: %s\' % (repr(e) or \'undefined.\')\n
except Exception, e:\n except Exception, e:\n
message = \'Problem: %s\' % (repr(e) or \'undefined.\')\n message = \'Problem: %s\' % (repr(e) or \'undefined.\')\n
except:\n except:\n
message = \'Problem: unknown\'\n message = \'Problem: unknown\'\n
# reach here, then exception was raised.\n \n
# message must be logged in workflow.\n # reach here, then exception was raised.\n
context.processFile(comment=message)\n # message must be logged in workflow.\n
# try again.\n context.processFile(comment=message)\n
context.activate(priority=3).convertToBaseFormat()\n # try again.\n
context.activate(priority=3).convertToBaseFormat()\n
return message\n return message\n
</string> </value> </string> </value>
</item> </item>
......
1043 1044
\ No newline at end of file \ No newline at end of file
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