[ARVADOS] updated: 4dbaf8c355f3743bd42ff5b917eda57d3e90abf8

Git user git at public.curoverse.com
Wed Feb 8 14:00:42 EST 2017


Summary of changes:
 apps/workbench/app/controllers/projects_controller.rb | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

       via  4dbaf8c355f3743bd42ff5b917eda57d3e90abf8 (commit)
      from  108467e2b85c9f3c44b483bc79f68acf6ae3b963 (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 4dbaf8c355f3743bd42ff5b917eda57d3e90abf8
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Wed Feb 8 15:59:18 2017 -0300

    3900: Reverted changes so that only Collection deletion from a project get deleted via an delete API call.

diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb
index 9a556d5..dbb087b 100644
--- a/apps/workbench/app/controllers/projects_controller.rb
+++ b/apps/workbench/app/controllers/projects_controller.rb
@@ -149,11 +149,16 @@ class ProjectsController < ApplicationController
         link.destroy
       end
 
-      if item.class == Collection && item.owner_uuid == @object.uuid
-        # Collection is owned by this project. Remove it from the project by
-        # changing owner to the current user before asking for deletion.
+      if item.class == Collection
+        # Use delete API on collections
+        @removed_uuids << item.uuid
+        item.destroy
+      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 ' +
@@ -163,13 +168,12 @@ class ProjectsController < ApplicationController
             updates[:name] = rename_to
             updates[:owner_uuid] = current_user.uuid
             item.update_attributes updates
+            @removed_uuids << item.uuid
           else
             raise
           end
         end
       end
-      @removed_uuids << item.uuid
-      item.destroy
     end
   end
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list