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

Batch ingest doesn't take older licenses #1115

Closed
weiweishi opened this issue May 2, 2019 · 4 comments
Closed

Batch ingest doesn't take older licenses #1115

weiweishi opened this issue May 2, 2019 · 4 comments
Assignees
Labels

Comments

@weiweishi
Copy link
Contributor

weiweishi commented May 2, 2019

Describe the bug
Batch ingest failed because it errored out on validating licenses for anything that's not on this list:
https://github.com/ualbertalib/jupiter/blob/master/config/controlled_vocabularies/license.yml

Expected behavior
we should be able to batch ingest with older licenses:
https://github.com/ualbertalib/jupiter/blob/master/config/controlled_vocabularies/old_license.yml
Example batch
#1088

@weiweishi weiweishi added the bug label May 3, 2019
@pgwillia
Copy link
Member

pgwillia commented Jun 6, 2019

Looks like there is already a test for this:

test 'a license must be either from the controlled vocabulary for new licenses or for old licenses' do
item = Item.new_locked_ldp_object(license: 'whatever')
assert_not item.valid?
assert_includes item.errors[:license], 'is not recognized'
item = Item.new_locked_ldp_object(license: CONTROLLED_VOCABULARIES[:license].attribution_4_0_international)
item.valid?
assert_not_includes item.errors.keys, :license
item = Item.new_locked_ldp_object(license: CONTROLLED_VOCABULARIES[:old_license].attribution_3_0_international)
item.valid?
assert_not_includes item.errors.keys, :license
end

@pgwillia
Copy link
Member

pgwillia commented Jun 6, 2019

And we seed data from this list too

item_attributes[:license] = CONTROLLED_VOCABULARIES[:old_license].attribution_3_0_international

Asked for access to the batch to investigate further.

@pgwillia
Copy link
Member

pgwillia commented Jun 6, 2019

It looks like the ingest script only accounts for the one

unlocked_obj.license = CONTROLLED_VOCABULARIES[:license].send(item_data[:license].to_sym)

@mbarnett
Copy link
Contributor

Looks like the work related to this is already merged. Closing (re-open if I'm wrong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants