Ticket #1338 (closed defect: fixed)
Exception when trying to use a custom form schema from an extension
Reported by: | amercader | Owned by: | amercader |
---|---|---|---|
Priority: | major | Milestone: | ckan-sprint-2011-10-28 |
Component: | ckan | Keywords: | |
Cc: | Repository: | ckan | |
Theme: | none |
Description
Both with the package and group controllers, when overriding the default _db_to_form_schema method (which does nothing) from an extension, you get an exception because the context is not passed to the validators.
File '/home/adria/dev/envs/iati/src/ckan/ckan/controllers/group.py', line 140 in edit old_data, errors = validate(old_data, schema) File '/home/adria/dev/envs/iati/src/ckan/ckan/lib/navl/dictization_functions.py', line 215 in validate converted_data, errors = _validate(flattened, schema, context) File '/home/adria/dev/envs/iati/src/ckan/ckan/lib/navl/dictization_functions.py', line 270 in _validate convert(converter, key, converted_data, errors, context) File '/home/adria/dev/envs/iati/src/ckan/ckan/lib/navl/dictization_functions.py', line 178 in convert converter(key, converted_data, errors, context) File '/home/adria/dev/envs/iati/src/ckan/ckan/logic/validators.py', line 108 in group_name_validator model = context['model'] KeyError: 'model'
Change History
Note: See
TracTickets for help on using
tickets.