Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk operations don't update the package_revision table #3199

Merged
merged 2 commits into from Aug 9, 2016

Conversation

Projects
None yet
2 participants
@amercader
Copy link
Member

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.

[#3199] Update revisions on bulk operations
`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

.filter(model.Package.owner_org == org_id) \
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)

This comment has been minimized.

Copy link
@wardi

wardi Aug 9, 2016

Contributor

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

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@amercader amercader deleted the 3199-bulk-operations-revisions branch Aug 25, 2016

amercader added a commit that referenced this pull request Aug 25, 2016

[#3199] Update revisions on bulk operations
`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

[#3199] Update revisions on bulk operations
`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

[#3199] Update revisions on bulk operations
`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
You can’t perform that action at this time.