don't assume the existence event code number
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 26 Apr 2009 17:42:29 +0000 (17:42 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 26 Apr 2009 17:42:29 +0000 (17:42 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12993 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/python/oils/event.py

index 9d5d3d8..58ecb19 100644 (file)
@@ -4,7 +4,10 @@ class Event(object):
     ''' Generic ILS event object '''
 
     def __init__(self, evt_hash={}):
-        self.code = int(evt_hash['ilsevent'])
+        if 'ilsevent' in evt_hash:
+            self.code = int(evt_hash['ilsevent'])
+        else:
+            self.code = -1
         self.text_code = evt_hash['textcode']
         self.desc = evt_hash.get('desc') or ''
         self.payload = evt_hash.get('payload')