[ARVADOS] updated: cab4d8ceb31408db8eb73cbf8396525d415c4434

Git user git at public.curoverse.com
Mon Sep 18 10:05:57 EDT 2017


Summary of changes:
 .../app/controllers/projects_controller.rb         | 27 ++++++++++++++++++++--
 apps/workbench/app/views/application/404.html.erb  |  2 +-
 2 files changed, 26 insertions(+), 3 deletions(-)

       via  cab4d8ceb31408db8eb73cbf8396525d415c4434 (commit)
       via  d3c3e67f95cb8c80fd5f7c86f4603752ab25addd (commit)
      from  d1814ec4769671c03b0ff597420d36e7e2772855 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit cab4d8ceb31408db8eb73cbf8396525d415c4434
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Sep 18 09:55:07 2017 -0400

    12125: Restore "move trashed items to home" behavior for now.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index a2ed89b..4a7563a 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -134,8 +134,31 @@ class ProjectsController < ApplicationController
     @removed_uuids = []
     links = []
     params[:item_uuids].collect { |uuid| ArvadosBase.find uuid }.each do |item|
-      item.destroy
-      @removed_uuids << item.uuid
+      if item.class == Collection or item.class == Group
+        # Use delete API on collections and projects/groups
+        item.destroy
+        @removed_uuids << item.uuid
+      elsif item.owner_uuid == @object.uuid
+        # Object is owned by this project. Remove it from the project by
+        # changing owner to the current user.
+        begin
+          item.update_attributes owner_uuid: current_user.uuid
+          @removed_uuids << item.uuid
+        rescue ArvadosApiClient::ApiErrorResponseException => e
+          if e.message.include? '_owner_uuid_'
+            rename_to = item.name + ' removed from ' +
+                        (@object.name ? @object.name : @object.uuid) +
+                        ' at ' + Time.now.to_s
+            updates = {}
+            updates[:name] = rename_to
+            updates[:owner_uuid] = current_user.uuid
+            item.update_attributes updates
+            @removed_uuids << item.uuid
+          else
+            raise
+          end
+        end
+      end
     end
   end
 

commit d3c3e67f95cb8c80fd5f7c86f4603752ab25addd
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Sep 15 08:33:22 2017 -0400

    12125: Fix 404 page when not showing a specific object.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/apps/workbench/app/views/application/404.html.erb b/apps/workbench/app/views/application/404.html.erb
index 31462ef..ee72ccd 100644
--- a/apps/workbench/app/views/application/404.html.erb
+++ b/apps/workbench/app/views/application/404.html.erb
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
    end
 %>
 
-  <% if check_trash.any? %>
+  <% if check_trash.andand.any? %>
     <h2>Trashed</h2>
 
     <p>The <%= req_item %> is in the trash.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list