[hooks] do not break if no entity created or updated during feed update
authornico
Mon, 14 Feb 2011 09:38:03 +0100
changeset 6988 2f4a7d1e15b3
parent 6984 528e44ef570c
child 6991 eb2ba251f093
child 6992 38f2e306ad8b
[hooks] do not break if no entity created or updated during feed update
hooks/__init__.py
--- a/hooks/__init__.py	Fri Feb 11 16:45:43 2011 +0100
+++ b/hooks/__init__.py	Mon Feb 14 09:38:03 2011 +0100
@@ -59,9 +59,9 @@
                         continue
                     try:
                         stats = source.pull_data(session)
-                        if stats['created']:
+                        if stats.get('created'):
                             source.info('added %s entities', len(stats['created']))
-                        if stats['updated']:
+                        if stats.get('updated'):
                             source.info('updated %s entities', len(stats['updated']))
                         session.commit()
                     except Exception, exc: