Skip to content

Conversation

@amercader
Copy link
Member

@amercader amercader commented Aug 9, 2016

bulk_update_private, bulk_update_public and bulk_update_delete change the package table and the search index but not the revision table, which causes the changes to not be reflected everywhere.

This fixes the model query and adds a bunch of tests.

`bulk_update_private`, `bulk_update_public` and ``bulk_update_delete`
changed the `package` table and the search index but not the revision
 table, which caused the changes to not be reflected everywhere.

This fixes the model query and adds a bunch of tests.
@wardi wardi self-assigned this Aug 9, 2016
model.Session.query(model.package_revision_table) \
.filter(model.PackageRevision.id.in_(datasets)) \
.filter(model.PackageRevision.owner_org == org_id) \
.update(update_dict, synchronize_session=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure we need to restrict to the latest revision here, don't we?

This code was changed in 0413e25#diff-4b95e302501a681a72c099ecc904de3dL1293 there should be a current=True in this query

@wardi wardi merged commit 0a3ea4b into master Aug 9, 2016
@amercader amercader deleted the 3199-bulk-operations-revisions branch August 25, 2016 14:56
amercader added a commit that referenced this pull request Aug 25, 2016
`bulk_update_private`, `bulk_update_public` and ``bulk_update_delete`
changed the `package` table and the search index but not the revision
 table, which caused the changes to not be reflected everywhere.

This fixes the model query and adds a bunch of tests.

Conflicts:
	ckan/tests/logic/action/test_update.py
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
`bulk_update_private`, `bulk_update_public` and ``bulk_update_delete`
changed the `package` table and the search index but not the revision
 table, which caused the changes to not be reflected everywhere.

This fixes the model query and adds a bunch of tests.

Conflicts:
	ckan/new_tests/logic/action/test_update.py
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
`bulk_update_private`, `bulk_update_public` and ``bulk_update_delete`
changed the `package` table and the search index but not the revision
 table, which caused the changes to not be reflected everywhere.

This fixes the model query and adds a bunch of tests.

Conflicts:
	ckan/tests/logic/action/test_update.py
amercader added a commit that referenced this pull request Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants