[ckan-changes] commit/ckanextiati: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri Nov 11 13:53:35 UTC 2011
2 new commits in ckanextiati:
https://bitbucket.org/okfn/ckanextiati/changeset/c563653b3f5b/
changeset: c563653b3f5b
user: amercader
date: 2011-11-11 14:52:51
summary: [archiver] More info in archiver logger message
affected #: 1 file
diff -r 0f0c62adec382fb32b49f88c89a774e9abe3b0df -r c563653b3f5b565fe98474701d8a89b049c5ceb1 ckanext/iati/commands.py
--- a/ckanext/iati/commands.py
+++ b/ckanext/iati/commands.py
@@ -135,7 +135,7 @@
format = '%Y-%m-%d %H:%M' if (date.hour and date.minute) else '%Y-%m-%d'
new_extras['data_updated'] = date.strftime(format)
except (ValueError,TypeError),e:
- log.error('Wrong date format for data_updated: %s' % str(e))
+ log.error('Wrong date format for data_updated for dataset %s: %s' % (package['name'],str(e)))
update = False
https://bitbucket.org/okfn/ckanextiati/changeset/1d9a3c4d786c/
changeset: 1d9a3c4d786c
user: amercader
date: 2011-11-11 14:53:27
summary: [spreadsheet] Check if publisher exists
affected #: 2 files
diff -r c563653b3f5b565fe98474701d8a89b049c5ceb1 -r 1d9a3c4d786c5097d8ef4ca14fb1eccabfa94b86 ckanext/iati/controllers/spreadsheet.py
--- a/ckanext/iati/controllers/spreadsheet.py
+++ b/ckanext/iati/controllers/spreadsheet.py
@@ -213,7 +213,7 @@
# We will now run the IATI specific validation, CKAN core will
# run the default one later on
schema = dict([(f[0],f[3]) for f in CSV_MAPPING])
- row, row_errors = validate(row,schema)
+ row, row_errors = validate(row,schema,context)
if row_errors:
for key, msgs in row_errors.iteritems():
log.error('Error in row %i: %s: %s' % (i+1,key,str(msgs)))
@@ -234,6 +234,10 @@
msg = 'Not authorized to publish to this group: %s' % row['registry-publisher-id']
log.error('Error in row %i: %s' % (i+1,msg))
errors[row_index]['registry-publisher-id'] = [msg]
+ except NotFound,e:
+ msg = 'Publisher not found: %s' % row['registry-publisher-id']
+ log.error('Error in row %i: %s' % (i+1,msg))
+ errors[row_index]['registry-publisher-id'] = [msg]
errors = sorted(errors.iteritems())
return counts['added'], counts['updated'], errors
diff -r c563653b3f5b565fe98474701d8a89b049c5ceb1 -r 1d9a3c4d786c5097d8ef4ca14fb1eccabfa94b86 ckanext/iati/logic/validators.py
--- a/ckanext/iati/logic/validators.py
+++ b/ckanext/iati/logic/validators.py
@@ -29,8 +29,9 @@
if not 'registry-publisher-id' in unflattened:
errors[key].append('Publisher name missing')
return
-
- group_name = unflattened['registry-publisher-id']
+ # Ask for the group details to ensure it actually exists
+ group = get_action('group_show')(context,{'id':unflattened['registry-publisher-id']})
+ group_name = group['name']
parts = value.split('-')
code_part = parts[-1]
Repository URL: https://bitbucket.org/okfn/ckanextiati/
--
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