X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d81ea65da05119d5c6480d373b5d42bbee8ae1ad..6207681aa301ad12d164aab24f52a210945af04b:/apps/workbench/app/controllers/user_agreements_controller.rb diff --git a/apps/workbench/app/controllers/user_agreements_controller.rb b/apps/workbench/app/controllers/user_agreements_controller.rb index 924bf44bae..bec11f2dc6 100644 --- a/apps/workbench/app/controllers/user_agreements_controller.rb +++ b/apps/workbench/app/controllers/user_agreements_controller.rb @@ -3,13 +3,19 @@ class UserAgreementsController < ApplicationController skip_before_filter :find_object_by_uuid skip_before_filter :check_user_profile + def index + if unsigned_user_agreements.empty? + redirect_to(params[:return_to] || :back) + end + end + def model_class Collection end def sign params[:checked].each do |checked| - if r = checked.match(/^([0-9a-f]+[^\/]*)/) + if (r = CollectionsHelper.match_uuid_with_optional_filepath(checked)) UserAgreement.sign uuid: r[1] end end