[ckan-changes] commit/ckanext-inspire: amercader: Fix bug in harvester (was not storing a package ref when updating)

Bitbucket commits-noreply at bitbucket.org
Thu Nov 10 17:18:08 UTC 2011


1 new commit in ckanext-inspire:


https://bitbucket.org/okfn/ckanext-inspire/changeset/ea159df68832/
changeset:   ea159df68832
user:        amercader
date:        2011-11-10 18:17:55
summary:     Fix bug in harvester (was not storing a package ref when updating)
affected #:  1 file

diff -r 40049a5b3236de9fc92148cc8c4d4feb7b7fffd5 -r ea159df68832d02e512311c231aa732e729ac187 ckanext/inspire/harvesters.py
--- a/ckanext/inspire/harvesters.py
+++ b/ckanext/inspire/harvesters.py
@@ -358,13 +358,13 @@
             package = self._create_package_from_data(package_dict)
             log.info('Created new package ID %s with GEMINI guid %s', package.id, gemini_guid)
 
-            # Set reference to package in the HarvestObject
-            self.obj.package = package
-            self.obj.save()
-
         else:
             package = self._create_package_from_data(package_dict, package = package)
             log.info('Updated existing package ID %s with existing GEMINI guid %s', package.id, gemini_guid)
+        
+        # Set reference to package in the HarvestObject
+        self.obj.package = package
+        self.obj.save()
 
         assert gemini_guid == package.harvest_objects[0].guid
         return package

Repository URL: https://bitbucket.org/okfn/ckanext-inspire/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list