From cb0a41c0304575aa20de9494feae2b7a410254e6 Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 21 Feb 2012 17:06:24 +0000 Subject: [PATCH] [bugfix][noticket] Activity streams fail if the object has no id property --- ckan/lib/activity.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ckan/lib/activity.py b/ckan/lib/activity.py index 9bbde7146fe..9fbc1a67e7f 100644 --- a/ckan/lib/activity.py +++ b/ckan/lib/activity.py @@ -92,6 +92,12 @@ def before_commit(self, session): objects = object_cache[activity_type] for obj in objects: logger.debug("Looking at %s object %s" % (activity_type, obj)) + + if not hasattr(obj,"id"): + logger.debug("Object has no id, skipping...") + continue + + if activity_type == "new" and obj.id in activities: logger.debug("This object was already logged as a new " "package")