From 39a5840a9f17fb13a1a5d2190664e875579e4f5c Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 21 Feb 2012 17:06:24 +0000 Subject: [PATCH 1/2] [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") From 74075f8696ec2ec8e2bd0e99ebbd09837bd2b3ba Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Tue, 21 Feb 2012 19:05:40 +0100 Subject: [PATCH 2/2] Correct a typo in a string --- ckan/templates/js_strings.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/templates/js_strings.html b/ckan/templates/js_strings.html index 55c056bdc96..513a5c2ad25 100644 --- a/ckan/templates/js_strings.html +++ b/ckan/templates/js_strings.html @@ -22,7 +22,7 @@ CKAN.Strings.failedToSave = "${_('Failed to save, possibly due to invalid data ')}"; CKAN.Strings.addDataset = "${_('Add Dataset')}"; CKAN.Strings.addGroup = "${_('Add Group')}"; - CKAN.Strings.youHaveUnsavedChanges = "${_("You have unsaved changed. Make sure to click 'Save Changes' below before leaving this page.")}"; + CKAN.Strings.youHaveUnsavedChanges = "${_("You have unsaved changes. Make sure to click 'Save Changes' below before leaving this page.")}"; CKAN.Strings.loading = "${_('Loading...')}"; CKAN.Strings.noNameBrackets = "${_('(no name)')}"; CKAN.Strings.deleteThisResourceQuestion = "${_('Delete the resource \'%name%\'?')}"