Merge branch 'master' of git.curoverse.com:arvados into 11876-r-sdk
[arvados.git] / services / api / app / models / container.rb
index b3739da9cfde9bc00a8a0e6e135b914398814e30..edcb8501a4621aa71be9eef5d68c719aac49a267 100644 (file)
@@ -437,12 +437,10 @@ class Container < ArvadosModel
     # that a container cannot "claim" a collection that it doesn't otherwise
     # have access to just by setting the output field to the collection PDH.
     if output_changed?
-      c = Collection.unscoped do
-        Collection.
-            readable_by(current_user).
+      c = Collection.
+            readable_by(current_user, {include_trash: true}).
             where(portable_data_hash: self.output).
             first
-      end
       if !c
         errors.add :output, "collection must exist and be readable by current user."
       end