[ARVADOS] created: 1.3.0-3246-g06b0aba33

Git user git at public.arvados.org
Thu Oct 1 18:36:59 UTC 2020


        at  06b0aba33e9d1b7a382f2d929a4f990ab4560f0c (commit)


commit 06b0aba33e9d1b7a382f2d929a4f990ab4560f0c
Merge: a24622f48 2a1a14393
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Thu Oct 1 15:36:21 2020 -0300

    16750: Merge branch 'master' into 16750-logincluster-wb1-trash-fix
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>


commit a24622f48b0bb81ef3c85545043c1e7c210d0fcf
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Thu Oct 1 10:52:23 2020 -0300

    16750: Avoids using limit & offset params on federated requests.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/apps/workbench/app/controllers/trash_items_controller.rb b/apps/workbench/app/controllers/trash_items_controller.rb
index 12ef20aa6..ad874533f 100644
--- a/apps/workbench/app/controllers/trash_items_controller.rb
+++ b/apps/workbench/app/controllers/trash_items_controller.rb
@@ -95,12 +95,16 @@ class TrashItemsController < ApplicationController
         owner_uuids = @objects.collect(&:owner_uuid).uniq
         @owners = {}
         @not_trashed = {}
-        Group.filter([["uuid", "in", owner_uuids]]).with_count("none").include_trash(true).each do |grp|
-          @owners[grp.uuid] = grp
-        end
-        User.filter([["uuid", "in", owner_uuids]]).with_count("none").include_trash(true).each do |grp|
-          @owners[grp.uuid] = grp
-          @not_trashed[grp.uuid] = true
+        federated_reqs = [User]
+        [Group, User].each do |owner_class|
+          owners_lst = owner_class.filter([["uuid", "in", owner_uuids]]).with_count("none").include_trash(true)
+          if !Rails.configuration.Login.LoginCluster.empty? && federated_reqs.include?(owner_class)
+            # Federated reqs avoid using 'offset' & 'limit' params
+            owners_lst = owners_lst.fetch_multiple_pages(false)
+          end
+          owners_lst.each do |owner|
+            @owners[owner.uuid] = owner
+          end
         end
         Group.filter([["uuid", "in", owner_uuids]]).with_count("none").select([:uuid]).each do |grp|
           @not_trashed[grp.uuid] = true
diff --git a/apps/workbench/app/models/user.rb b/apps/workbench/app/models/user.rb
index 34e818151..c4b273c6b 100644
--- a/apps/workbench/app/models/user.rb
+++ b/apps/workbench/app/models/user.rb
@@ -110,6 +110,6 @@ class User < ArvadosBase
   end
 
   def self.creatable?
-    current_user and current_user.is_admin
+    current_user.andand.is_admin
   end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list