[open-ils-commits] r12994 - trunk/Open-ILS/src/python/oils (erickson)

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


Author: erickson
Date: 2009-04-26 14:22:35 -0400 (Sun, 26 Apr 2009)
New Revision: 12994

Modified:
   trunk/Open-ILS/src/python/oils/event.py
Log:
ilsevent may be present, but null, be safer

Modified: trunk/Open-ILS/src/python/oils/event.py
===================================================================
--- trunk/Open-ILS/src/python/oils/event.py	2009-04-26 17:42:29 UTC (rev 12993)
+++ trunk/Open-ILS/src/python/oils/event.py	2009-04-26 18:22:35 UTC (rev 12994)
@@ -4,9 +4,9 @@
     ''' Generic ILS event object '''
 
     def __init__(self, evt_hash={}):
-        if 'ilsevent' in evt_hash:
+        try:
             self.code = int(evt_hash['ilsevent'])
-        else:
+        except:
             self.code = -1
         self.text_code = evt_hash['textcode']
         self.desc = evt_hash.get('desc') or ''



More information about the open-ils-commits mailing list