[ckan-changes] commit/ckanext-inspire: amercader: Better message for metadata date exception

Bitbucket commits-noreply at bitbucket.org
Wed May 11 13:46:02 UTC 2011


1 new changeset in ckanext-inspire:

http://bitbucket.org/okfn/ckanext-inspire/changeset/5f454855440a/
changeset:   r27:5f454855440a
user:        amercader
date:        2011-05-11 15:45:43
summary:     Better message for metadata date exception
affected #:  1 file (86 bytes)

--- a/ckanext/inspire/harvesters.py	Tue May 10 17:10:04 2011 +0100
+++ b/ckanext/inspire/harvesters.py	Wed May 11 14:45:43 2011 +0100
@@ -204,8 +204,8 @@
 
             # Use reference date instead of content to determine if the package
             # needs to be updated
-            if last_harvested_object.reference_date < self.obj.reference_date \
-                or last_harvested_object.reference_date is None \
+            if last_harvested_object.reference_date is None \
+                or last_harvested_object.reference_date < self.obj.reference_date \
                 or self.force_import:
 
                 if self.force_import:
@@ -215,8 +215,9 @@
 
                 package = last_harvested_object.package
             else:
-                if last_harvested_object.content != self.obj.content:
-                    raise Exception('The contents of document with GUID %s changed, but the reference date has not been updated' % gemini_guid)
+                if last_harvested_object.content != self.obj.content and \
+                 last_harvested_object.reference_date == self.obj.reference_date:
+                    raise Exception('The contents of document with GUID %s changed, but the metadata date has not been updated' % gemini_guid)
                 else:
                     # The content hasn't changed, no need to update the package
                     log.info('Document with GUID %s unchanged, skipping...' % (gemini_guid))

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