Ticket #1338 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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

comment:1 Changed 3 years ago by amercader

  • Status changed from new to closed
  • Resolution set to fixed

comment:2 Changed 3 years ago by amercader

  • Status changed from closed to reopened
  • Resolution fixed deleted

Reopening, because another change is needed to support custom schemas

comment:3 Changed 3 years ago by amercader

  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed in eca1edce3a0f

Note: See TracTickets for help on using tickets.