Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2815] Fix tracking info and isopen being stripped by validate
The 'tracking_summary' and 'isopen' fields were being stripped from package dicts by validation. Only happened when there was a schema in use that packages dict were being validated against, e.g. when there was an IDatasetForm plugin with a db_to_form_schema() method. When dictizing packages, 'tracking_summary' was being added to package dicts as a sub-dict with two keys 'total' and 'recent', but ckan/lib/navl/dictization_functions.py:validate() does not allow package dicts to contain sub-dicts ("Only lists of dicts can be placed against subschema"), they can contain only single values (e.g. strings, numbers, bools) or lists of dicts (e.g. list of tag dicts) but not single dicts. So change the dictization of packages to add two keys 'tracking_summary_total' and 'tracking_summary_recent' instead. Add 'tracking_summary_total', 'tracking_summary_recent' and 'isopen' to default_package_schema() so that they do not get stripped from package dicts during validation. Update a few tests now that package dicts have these three new keys.
- Loading branch information
Sean Hammond
committed
Aug 8, 2012
1 parent
f67c571
commit ecf4ec6
Showing
6 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters