[ckan-changes] [ckan/ckan] 6532c1: [#1894] Fix convert_to_extras to allow use with no...

GitHub noreply at github.com
Wed Sep 10 15:22:28 UTC 2014


  Branch: refs/heads/release-v2.2.1
  Home:   https://github.com/ckan/ckan
  Commit: 6532c1677d4a74fab9b984fc30e4ae63ed2a0e40
      https://github.com/ckan/ckan/commit/6532c1677d4a74fab9b984fc30e4ae63ed2a0e40
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    M ckan/logic/converters.py
    A ckan/new_tests/lib/navl/test_converters.py

  Log Message:
  -----------
  [#1894] Fix convert_to_extras to allow use with normal extras

`convert_to_extras` was adding the custom fields in an unflattened way
during validation to the object that would be later unflattened. This
worked fine if there were only `convert_to_extras` fields, but not if
you were also providing actual extras, eg

    data_dict = {
  'name': 'test-dataset',
  'custom_text': 'Hi',
  'custom_text2': 'Hi2',
  'extras': [
      {'key': 'proper_extra', 'value': 'Bye'},
  ]

    }

This fixes the `convert_to_extras` output and adds new converters test for it.


  Commit: cfadddc1a775fbbcd839bd0b5764991555aeface
      https://github.com/ckan/ckan/commit/cfadddc1a775fbbcd839bd0b5764991555aeface
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    R ckan/new_tests/lib/navl/test_converters.py
    A ckan/new_tests/logic/test_conversion.py
    M ckan/new_tests/logic/test_converters.py

  Log Message:
  -----------
  [#1894] Move test files to proper place

Moved functional tests to ckan/new_tests/logic/test_conversion.py and
added new unit tests for `convert_to_extras` to
ckan/new_tests/logic/test_converters.py


  Commit: 98afbf66b432b0dfe0958e9acae0417e4f64b950
      https://github.com/ckan/ckan/commit/98afbf66b432b0dfe0958e9acae0417e4f64b950
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    M ckan/lib/navl/dictization_functions.py
    A ckan/new_tests/lib/navl/test_dictization_functions.py

  Log Message:
  -----------
  [#1894] Pass a list of keys in the schema to validators

This is included in the context. We pass a copy of the one provided to
validate.


  Commit: 00bee37364a239332a025a92e3abc7295487cd29
      https://github.com/ckan/ckan/commit/00bee37364a239332a025a92e3abc7295487cd29
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    M ckan/logic/schema.py
    M ckan/logic/validators.py
    M ckan/new_tests/logic/test_conversion.py

  Log Message:
  -----------
  [#1894] Prevent free extras to have the same key as a schema field

Added a new validator to the 'key' field of the extras schema that
checks if the value is present on the 'schema_fields' list that was
added to the context on the previous commit.


  Commit: 355d91d95fe95da1a5e394f83a536fe2abbd0b6c
      https://github.com/ckan/ckan/commit/355d91d95fe95da1a5e394f83a536fe2abbd0b6c
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    M ckan/logic/__init__.py

  Log Message:
  -----------
  [#1894] (Partially) Fix the error_summary for extras validation errors

If there is a validation error on the extras, the error summary would
*always* be `Missing Value`. I guess it was assumed that all validation
errors would be that the extra key was missing. The fix is not ideal, as
it still assumes that all errors will be on the 'key' field (there could
be custom validation on the value), but at least it will show more than
one error, and the ones different from `Missing Value`.

This can furhter be improved, eg changing the macro that renders the
error summary on the templates to allow lists of errors, and maybe
showing the error below the actual extra field (using the index?)


  Commit: ef571877cd552fd6158104439175953edcb4c404
      https://github.com/ckan/ckan/commit/ef571877cd552fd6158104439175953edcb4c404
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    M ckanext/example_idatasetform/templates/package/snippets/package_metadata_fields.html

  Log Message:
  -----------
  [#1894] Update docs and example_idatasetform to reflect changes

For the 2.2.1 branch, only changes in the snippet were added, as the docs page
does not exist here


  Commit: d7f2454be39654b457a70b61e8feb3f13f32334f
      https://github.com/ckan/ckan/commit/d7f2454be39654b457a70b61e8feb3f13f32334f
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    M ckan/new_tests/logic/test_conversion.py

  Log Message:
  -----------
  [#1894] Simplify conversion tests

Don't load `example_idatasetform` as this causes failures in other
tests. Rather pass a schema directly.


  Commit: 95ea8887187aee30da5a52d935ef6d9ab6ebeb3e
      https://github.com/ckan/ckan/commit/95ea8887187aee30da5a52d935ef6d9ab6ebeb3e
  Author: amercader <amercadero at gmail.com>
  Date:   2014-09-10 (Wed, 10 Sep 2014)

  Changed paths:
    M ckan/templates/snippets/organization.html

  Log Message:
  -----------
  [#1882] Fix org link in dataset page

Replaced use of `with` in the snippet.

Conflicts:
	ckan/templates/snippets/organization.html


Compare: https://github.com/ckan/ckan/compare/e9e74d284159...95ea8887187a


More information about the ckan-changes mailing list