[ckan-changes] commit/ckan: kindly: [formalchemy] ticket 1193 formalchemy changes break resources
Bitbucket
commits-noreply at bitbucket.org
Sun Jun 19 23:24:08 UTC 2011
1 new changeset in ckan:
http://bitbucket.org/okfn/ckan/changeset/87d6140e06ad/
changeset: 87d6140e06ad
user: kindly
date: 2011-06-20 01:23:54
summary: [formalchemy] ticket 1193 formalchemy changes break resources
affected #: 1 file (15 bytes)
--- a/ckan/forms/common.py Fri Jun 17 14:50:30 2011 +0100
+++ b/ckan/forms/common.py Mon Jun 20 00:23:54 2011 +0100
@@ -337,6 +337,7 @@
def resource_validator(self, val, field=None):
resources_data = val
+ print resources_data
assert isinstance(resources_data, list)
not_nothing_regex = re.compile('\S')
errormsg = _('Package resource(s) incomplete.')
@@ -402,14 +403,14 @@
def _serialized_value(self):
package = self.field.parent.model
- params = dict(self.params)
+ params = self.params
new_resources = []
rest_key = self.name
# REST param format
# e.g. 'Package-1-resources': [{u'url':u'http://ww...
- if params.has_key(rest_key) and isinstance(params[rest_key], (list, tuple)):
- new_resources = params[rest_key][:] # copy, so don't edit orig
+ if params.has_key(rest_key) and any(params.getall(rest_key)):
+ new_resources = params.getall(rest_key)[:] # copy, so don't edit orig
# formalchemy form param format
# e.g. 'Package-1-resources-0-url': u'http://ww...'
Repository URL: https://bitbucket.org/okfn/ckan/
--
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