[ckan-changes] commit/ckan: amercader: [forms] (2nd) Fix for #1338 (Exception when trying to use a custom form schema from an extension)
Bitbucket
commits-noreply at bitbucket.org
Tue Sep 27 09:55:30 UTC 2011
1 new changeset in ckan:
http://bitbucket.org/okfn/ckan/changeset/eca1edce3a0f/
changeset: eca1edce3a0f
user: amercader
date: 2011-09-27 11:55:17
summary: [forms] (2nd) Fix for #1338 (Exception when trying to use a custom form schema from an extension)
affected #: 2 files (-1 bytes)
--- a/ckan/controllers/group.py Tue Sep 27 01:05:03 2011 +0100
+++ b/ckan/controllers/group.py Tue Sep 27 10:55:17 2011 +0100
@@ -136,7 +136,7 @@
c.grouptitle = old_data.get('title')
c.groupname = old_data.get('name')
schema = self._db_to_form_schema()
- if schema:
+ if schema and not data:
old_data, errors = validate(old_data, schema, context=context)
data = data or old_data
--- a/ckan/controllers/package.py Tue Sep 27 01:05:03 2011 +0100
+++ b/ckan/controllers/package.py Tue Sep 27 10:55:17 2011 +0100
@@ -365,7 +365,7 @@
try:
old_data = get_action('package_show')(context, {'id':id})
schema = self._db_to_form_schema()
- if schema:
+ if schema and not data:
old_data, errors = validate(old_data, schema, context=context)
data = data or old_data
except NotAuthorized:
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