[ckan-changes] commit/ckan: kindly: [formalchemy] fix due to change in formalchemy

Bitbucket commits-noreply at bitbucket.org
Mon Jun 20 11:14:44 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/bbd6e9dd8897/
changeset:   bbd6e9dd8897
branch:      release-v1.4.1
user:        kindly
date:        2011-06-20 13:14:20
summary:     [formalchemy] fix due to change in formalchemy
affected #:  1 file (14 bytes)

--- a/ckan/forms/common.py	Fri Jun 17 19:01:47 2011 +0100
+++ b/ckan/forms/common.py	Mon Jun 20 12:14:20 2011 +0100
@@ -402,14 +402,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