[open-ils-commits] r12995 - branches/rel_1_4/Open-ILS/src/python/oils (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Apr 26 14:26:13 EDT 2009


Author: erickson
Date: 2009-04-26 14:26:10 -0400 (Sun, 26 Apr 2009)
New Revision: 12995

Modified:
   branches/rel_1_4/Open-ILS/src/python/oils/event.py
Log:
backporting safer ilsevent handling

Modified: branches/rel_1_4/Open-ILS/src/python/oils/event.py
===================================================================
--- branches/rel_1_4/Open-ILS/src/python/oils/event.py	2009-04-26 18:22:35 UTC (rev 12994)
+++ branches/rel_1_4/Open-ILS/src/python/oils/event.py	2009-04-26 18:26:10 UTC (rev 12995)
@@ -4,7 +4,10 @@
     ''' Generic ILS event object '''
 
     def __init__(self, evt_hash={}):
-        self.code = int(evt_hash['ilsevent'])
+        try:
+            self.code = int(evt_hash['ilsevent'])
+        except:
+            self.code = -1
         self.text_code = evt_hash['textcode']
         self.desc = evt_hash.get('desc') or ''
         self.payload = evt_hash.get('payload')



More information about the open-ils-commits mailing list