[ARVADOS] updated: 2c055a4770ed7e7ef2d0ce8e33d0eaef37e71336

git at public.curoverse.com git at public.curoverse.com
Fri Jun 27 18:21:18 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/application_controller.rb | 12 +++++++++++-
 apps/workbench/app/controllers/collections_controller.rb |  2 +-
 apps/workbench/app/views/application/404.html.erb        |  7 +++----
 apps/workbench/app/views/layouts/application.html.erb    |  5 -----
 4 files changed, 15 insertions(+), 11 deletions(-)

       via  2c055a4770ed7e7ef2d0ce8e33d0eaef37e71336 (commit)
       via  c92fbef67b37db8dc80be9bee98f3100ebcb9417 (commit)
       via  93b56a1756eb5aa87dd195ac603a11762e1e39c9 (commit)
      from  d3d2311db3b942d41ef6746cb29d8a31a2ecbfa2 (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 2c055a4770ed7e7ef2d0ce8e33d0eaef37e71336
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Jun 27 18:14:32 2014 -0400

    2891: Fixup 6a62c302: Handle project tree exceptions in render_exception.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 3fba9f9..a8886d1 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -66,6 +66,15 @@ class ApplicationController < ActionController::Base
     rescue ArvadosApiClient::ApiError
       load_api_token(nil)
     end
+    # Preload projects trees for the template.  If that fails, set empty
+    # trees so error page rendering can proceed.  (It's easier to rescue the
+    # exception here than in a template.)
+    begin
+      build_project_trees
+    rescue ArvadosApiClient::ApiError
+      @my_project_tree ||= []
+      @shared_project_tree ||= []
+    end
     render_error(err_opts)
   end
 
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index cccef64..45e1ae2 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -156,7 +156,6 @@
     </nav>
 
     <% if current_user.andand.is_active %>
-     <% begin %>
       <nav class="navbar navbar-default breadcrumbs" role="navigation">
         <ul class="nav navbar-nav navbar-left">
           <li class="dropdown">
@@ -181,10 +180,6 @@
           <% end %>
         </ul>
       </nav>
-     <% rescue ArvadosApiClient::NotLoggedInException %>
-       <% raise  # Let ApplicationController handle this. %>
-     <% rescue ArvadosApiClient::ApiError  # Just skip rendering projects.  %>
-     <% end %>
     <% end %>
 
     <div id="page-wrapper">

commit c92fbef67b37db8dc80be9bee98f3100ebcb9417
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Jun 27 17:39:06 2014 -0400

    2891: Fixup 947e48e6: find_object_by_uuid renders 404 if not found.
    
    This better accommodates all the controllers whose show method assumes
    @object is not nil.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index cb04fae..3fba9f9 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -348,7 +348,8 @@ class ApplicationController < ActionController::Base
         @object = model_class.find(params[:uuid])
       end
     rescue ArvadosApiClient::NotFoundException => error
-      @object = nil
+      render_not_found(error)
+      return false
     end
   end
 
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index dd1ac2f..5a7a522 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -118,7 +118,7 @@ class CollectionsController < ApplicationController
 
   def show_file_links
     Thread.current[:reader_tokens] = [params[:reader_token]]
-    find_object_by_uuid
+    return if false.equal?(find_object_by_uuid)
     render layout: false
   end
 

commit 93b56a1756eb5aa87dd195ac603a11762e1e39c9
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Jun 27 17:35:42 2014 -0400

    2891: Fixup 57d48418: Controller-based 404 index link generation.

diff --git a/apps/workbench/app/views/application/404.html.erb b/apps/workbench/app/views/application/404.html.erb
index 8141039..c1f48bd 100644
--- a/apps/workbench/app/views/application/404.html.erb
+++ b/apps/workbench/app/views/application/404.html.erb
@@ -2,11 +2,10 @@
 
 <p>The item you requested was not found.
 
-<% if params[:uuid] and (model_class = resource_class_for_uuid(params[:uuid]))
-     then class_name = model_class.to_s.underscore.pluralize %>
+<% if controller.andand.action_name == 'show' %>
 Perhaps you'd like to
-<%= link_to("browse all #{class_name.humanize(capitalize: false)}",
-            send("#{class_name}_path".to_sym)) %>?
+<%= link_to("browse all #{controller.model_class.to_s.underscore.pluralize.humanize(capitalize: false)}",
+            action: :index) %>?
 <% end %>
 
 </p>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list