-
Notifications
You must be signed in to change notification settings - Fork 124
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
Fix single use links for Valkyrie. #6226
Changes from all commits
8768152
01813d3
319e709
f7856aa
b3cdd44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
members { nil } | ||
visibility_setting { nil } | ||
with_index { true } | ||
uploaded_files { [] } | ||
end | ||
|
||
after(:build) do |work, evaluator| | ||
|
@@ -41,6 +42,15 @@ | |
.new(resource: work) | ||
.assign_access_for(visibility: evaluator.visibility_setting) | ||
end | ||
if evaluator.uploaded_files.present? | ||
Hyrax::WorkUploadsHandler.new(work: work).add(files: evaluator.uploaded_files).attach | ||
evaluator.uploaded_files.each do |file| | ||
allow(Hyrax.config.characterization_service).to receive(:run).and_return(true) | ||
# I don't love this - we might want to just run background jobs so | ||
# this is more real, but we'd have to stub some things. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could we do ActiveJob::Base.queue_adapter.filter += [ValkyrieIngestJob] Hyrax already makes use of the old_perform_enqueued_setting = ActiveJob::Base.queue_adapter.perform_enqueued_jobs
old_job_filter = ActiveJob::Base.queue_adapter.filter
ActiveJob::Base.queue_adapter.perform_enqueued_jobs = true
ActiveJob::Base.queue_adapter.filter += [ValkyrieIngestJob]
allow(Hyrax.config.characterization_service).to receive(:run).and_return(true)
Hyrax::WorkUploadsHandler.new(work: work).add(files: evaluator.uploaded_files).attach
ActiveJob::Base.queue_adapter.perform_enqueued_jobs = old_perform_enqueued_setting
ActiveJob::Base.queue_adapter.filter = old_job_filter maybe more than is worth messing with? the stub on this issue is probably out of scope here, but fixing it would let us rely on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had a version that did The big problem is just fits tries to run and it's not installed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does the stub not take effect through the adapter? |
||
ValkyrieIngestJob.perform_now(file) | ||
end | ||
end | ||
|
||
work.permission_manager.edit_groups = evaluator.edit_groups | ||
work.permission_manager.edit_users = evaluator.edit_users | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏻