[ckan-changes] [okfn/ckan] 1abef5: Add 'state' to db_to_form_package_schema

GitHub noreply at github.com
Tue Feb 19 17:40:44 UTC 2013


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: 1abef578fe7cc89f5c80cc1e0df7ecd2f06dd7b1
      https://github.com/okfn/ckan/commit/1abef578fe7cc89f5c80cc1e0df7ecd2f06dd7b1
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Add 'state' to db_to_form_package_schema

Fixes #370


  Commit: 51707384b13eaf7c34d32857e8b4a1252f6b6dab
      https://github.com/okfn/ckan/commit/51707384b13eaf7c34d32857e8b4a1252f6b6dab
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Add isopen, license_url, license_title to db_to_form_package_schema

Fixes #375


  Commit: 844f245aed8ded90846f79af2f2efee526c8563f
      https://github.com/okfn/ckan/commit/844f245aed8ded90846f79af2f2efee526c8563f
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Add group description to db_to_form_package_schema

Fixes #372


  Commit: deebae7f1492cb04b25051f5d262006c5ac8ff89
      https://github.com/okfn/ckan/commit/deebae7f1492cb04b25051f5d262006c5ac8ff89
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Add default_tags_schema to form_to_db_package_schema

This fixes lots of "input field __junk was not expected" when running
the ckan tests with an IDatasetForm plugin active (and hence the
form_to_db package validation active).


  Commit: 0bde2f196cbad22e06609cdd752fe250c3ff6f04
      https://github.com/okfn/ckan/commit/0bde2f196cbad22e06609cdd752fe250c3ff6f04
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/controllers/package.py

  Log Message:
  -----------
  Don't put api version in context when creating datasets in web ui

The form_to_db_schema() methods of IDatasetForm plugins were not getting
called when creating datasets in the web interface, if the IDatasetForm
plugin inherits from DefaultDatasetForm.

The reason was that DefaultDatasetForm's form_to_db_schema() method
deliberately doesn't call the method if the dataset is being created via
the API, and the package controller's new_resources() and new_metadata()
methods (for the new three-stage dataset creation) put the API version
in the context, so DefaultDatasetForm thinks it's being used over the
API.

Change the package controller to not put the API version in the context.

Fixes #390.


  Commit: ef2ac5ed8df4759d36ff372e8fdf2cc4af845cad
      https://github.com/okfn/ckan/commit/ef2ac5ed8df4759d36ff372e8fdf2cc4af845cad
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/lib/plugins.py

  Log Message:
  -----------
  Fix DefaultDatasetForm's check_data_dict()

Some recent commits (I think maybe ec8f69c and b6ccfca) caused
DefaultDatasetForm's check_data_dict() method to start raising Integrity
Error when creating a dataset using the web ui. Make check_data_dict() a
bit more liberal so it doesn't raise these errors anymore.


  Commit: e4518c232934cb6952ebf75d1bae62f6a4b18f87
      https://github.com/okfn/ckan/commit/e4518c232934cb6952ebf75d1bae62f6a4b18f87
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/tests/functional/test_package.py

  Log Message:
  -----------
  Update a couple of tests broken by commit 0f7d6a2

These tests relied on DefaultDatasetForm's check_data_dict throwing an
error, but since commit 0f7d6a2 made check_data_dict more liberal it
wasn't throwing the error anymore, tweak the tests to submit forms that
check_data_dict will still throw an error for.


  Commit: 34d71b5e56db24206d2d04bacddf11bc1966db1d
      https://github.com/okfn/ckan/commit/34d71b5e56db24206d2d04bacddf11bc1966db1d
  Author: Ian Ward <ian at excess.org>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/lib/navl/dictization_functions.py

  Log Message:
  -----------
  default to not-broken navl validation

But, frankly all of pull request #2671 is suspect


  Commit: dbf2bcce346be5ef20ea45bce7fa9bbbc4901659
      https://github.com/okfn/ckan/commit/dbf2bcce346be5ef20ea45bce7fa9bbbc4901659
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Don't strip id's from extras in validate()

db_to_form_package_schema() (which is only used if an IDatasetForm
plugin is active) was stripping the "id" keys from package extras, which
then causes some tests to fail. Not sure if just the tests were
crashing, or if some ckan pages were also crashing. Anyway, this commit
means they don't get stripped anymore.

Fixes #406


  Commit: 5cd0401e13bad2c2a3a279b13d141fc524191ac4
      https://github.com/okfn/ckan/commit/5cd0401e13bad2c2a3a279b13d141fc524191ac4
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Revert "[#406] Don't strip id's from extras in validate()"

This reverts commit ecfacbbc41d85bc4a83bd3ac008f185ec31b9185.

It's fine to strip IDs from extras, extra IDs are never useful or needed
by users. Any tests that are failing (or templates that are crashing,
etc.) by trying to read extra IDs should be fixed to not read extra IDs.


  Commit: 4a1212df555779f323481e5f840399ddbdb5c437
      https://github.com/okfn/ckan/commit/4a1212df555779f323481e5f840399ddbdb5c437
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/tests/functional/api/test_activity.py

  Log Message:
  -----------
  Fix some broken tests

These tests were failing when run with an IDatasetForm plugin active
because they're trying to read extra IDs, which they shouldn't do.
Change the tests to not read extra IDs, now they pass.

See commits ecfacbbc4 and e6acbd4bc645.


  Commit: d9ffebd25897a1b380626d3519cfe8182c403850
      https://github.com/okfn/ckan/commit/d9ffebd25897a1b380626d3519cfe8182c403850
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  db_to_form_package_schema don't strip keys

Add empty lists to db_to_form_package_schema() for several keys that
normally appear in dicts from package_show, but that were being stripped
from thos dicts when db_to_form_package_schema() was used (i.e. when an
IDatasetForm plugin was active). Fixes #407.


  Commit: 2cb4bda3ec7eb58a4b2191557ca8658c77e87583
      https://github.com/okfn/ckan/commit/2cb4bda3ec7eb58a4b2191557ca8658c77e87583
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  db_to_form_package_schema() don't strip keys from resource dicts

Add several keys to the 'resources' subschema in
db_to_form_package_schema() so that validation doesn't strip the keys
from the resources dicts. This fixes a test that was failing if run with
an IDatasetForm plugin active, and may also fix some template crashes
when an IDatasetForm plugin is active if people are accessing these
resource keys in their templates.

Fixes #415.


  Commit: df1209c706748c65077144dff5c762dc86b6b63e
      https://github.com/okfn/ckan/commit/df1209c706748c65077144dff5c762dc86b6b63e
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Remove free_tags_only from db_to_form_package_schema()

Remove the free_tags_only converter from db_to_form_package_schema's
tags subschema.

This fixes a couple of tag vocabularies tests that were failing.

Not sure if this at the same time breaks something that we don't have
tests for, we may have to put this back in later if we find a problem.


  Commit: be6058b3044043a15532dbfec910612439f9e2fc
      https://github.com/okfn/ckan/commit/be6058b3044043a15532dbfec910612439f9e2fc
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Delete some unhelpful comments

Not clear what these comments mean or whether it's still true.


  Commit: bb5c4dc721d87533a01563b7e2798028c343916b
      https://github.com/okfn/ckan/commit/bb5c4dc721d87533a01563b7e2798028c343916b
  Author: Ian Ward <ian at excess.org>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/lib/navl/dictization_functions.py

  Log Message:
  -----------
  navl.validate: unflatten before restoring empty lists


  Commit: 4d24f0e94667d458584545d16b5fcf31b11956f7
      https://github.com/okfn/ckan/commit/4d24f0e94667d458584545d16b5fcf31b11956f7
  Author: Ian Ward <ian at excess.org>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/lib/navl/dictization_functions.py

  Log Message:
  -----------
  navl.validate: fix key names in restored empty lists


  Commit: 18ac4f9d14525d0d983b185b9f406080b33b23b5
      https://github.com/okfn/ckan/commit/18ac4f9d14525d0d983b185b9f406080b33b23b5
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Add license_title back to db_to_form_package_schema()

Looks like this got removed by accident, so license titles weren't
showing on dataset pages.


  Commit: 77663865a35a3ac25a20923eb77a5c2538b4380b
      https://github.com/okfn/ckan/commit/77663865a35a3ac25a20923eb77a5c2538b4380b
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Revert "Remove free_tags_only from db_to_form_package_schema()"

This reverts commit aaa10bbff6e4c704e58f651f13b5b18cfa0a2571.

The free_tags_only converter is needed after all, because it prevents
vocab tags from appearing as normal tags on the dataset read and search
pages.

Reverting aaa10bbf means that a couple of tests are failing, but I think
it's the tests that are wrong not the code.


  Commit: 9a15bd5b30b0f29778c4260f9c5929f4d96bddad
      https://github.com/okfn/ckan/commit/9a15bd5b30b0f29778c4260f9c5929f4d96bddad
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/action/update.py

  Log Message:
  -----------
  Don't pass api version to form_to_db_schema_options()

Fixes #417.


  Commit: 5f2341b53976b35c4ee27228636582426a6bd2f5
      https://github.com/okfn/ckan/commit/5f2341b53976b35c4ee27228636582426a6bd2f5
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/action/update.py

  Log Message:
  -----------
  Revert "[#417] Don't pass api version to form_to_db_schema_options()"

This reverts commit e023d8a5f50baf3931e2610eaa433b5653227154.

e023d8a5 was the wrong fix and broke a bunch of tests, package_update()
was only passing 'api': True if it was in fact called via the api, which
is what it should do.

The real bug is in the package controller's _save_edit() method, which
puts the api version in the context even though it's a web ui method not
an api method. I'll fix that in the next commit...


  Commit: a671c38de754b91a85aeb5b74c7b11fd90dd0b30
      https://github.com/okfn/ckan/commit/a671c38de754b91a85aeb5b74c7b11fd90dd0b30
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/controllers/package.py

  Log Message:
  -----------
  Package controller: Don't put api version in context on package update

Don't put 'api_version' in the request context when calling
package_update() from the package controller, it makes package_update()
think it's being called by the api when in fact it's being called by the
web ui, and that then breaks IDatasetForm.


  Commit: 429601cd623ab4141778f85fd3b4cc30a5ca1d78
      https://github.com/okfn/ckan/commit/429601cd623ab4141778f85fd3b4cc30a5ca1d78
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/lib/plugins.py

  Log Message:
  -----------
  Add some more surplus keys to DefaultDatasetForm

Add some more surplus keys to DefaultDatasetForm's check_data_dict(),
this fixes a crash when updating a package over the web ui when an
IDatasetForm plugin is active.


  Commit: 4f7b9a00cfe4e3eb3dc9c6d8b76b2602f9447ddc
      https://github.com/okfn/ckan/commit/4f7b9a00cfe4e3eb3dc9c6d8b76b2602f9447ddc
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/tests/functional/test_package.py

  Log Message:
  -----------
  Update a couple of tests broken by commit e023d8a


  Commit: b022dda07e2a46995141acf805073706890197fd
      https://github.com/okfn/ckan/commit/b022dda07e2a46995141acf805073706890197fd
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Add a comment


  Commit: acc65c5bf7182776ee81494465d5af58fa0a5a13
      https://github.com/okfn/ckan/commit/acc65c5bf7182776ee81494465d5af58fa0a5a13
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-02-19 (Tue, 19 Feb 2013)

  Changed paths:
    M ckan/logic/schema.py

  Log Message:
  -----------
  Delete a commented-out line


Compare: https://github.com/okfn/ckan/compare/9ab8663a9b45...acc65c5bf718


More information about the ckan-changes mailing list