Skip to content

Commit

Permalink
Only check resource is a work instead of stricter check of registered…
Browse files Browse the repository at this point in the history
… curation concern
  • Loading branch information
cjcolvar authored and tamsin johnson committed Sep 14, 2022
1 parent b1af153 commit 286a10c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/services/hyrax/work_resource_query_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ def deleted_work?
def work
# Need to ensure it is a work?
resource = Hyrax.query_service.find_by(id: id)
unless Hyrax.config.curation_concerns.include?(resource.class) ||
Hyrax.config.curation_concerns.map(&:to_s).include?(resource.class.to_s) || # Wings-wrapped models
Hyrax.config.curation_concerns.map(&:to_s).include?(resource.class.name) # Wings-wrapped models
raise ModelMismatchError, "Expected allowed work type but got #{resource.class}"
end
raise ModelMismatchError, "Expected work but got #{resource.class}" unless resource.work?
resource
end

Expand Down

0 comments on commit 286a10c

Please sign in to comment.