X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/fde712e92ad33e03dfd79f5fca99d2005cdd0795..b521d2c5254e439e23cd750f86d55eadffb3e4b9:/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..bdfaa24033 100644 --- a/apps/workbench/app/controllers/user_agreements_controller.rb +++ b/apps/workbench/app/controllers/user_agreements_controller.rb @@ -1,7 +1,17 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class UserAgreementsController < ApplicationController - skip_before_filter :check_user_agreements - skip_before_filter :find_object_by_uuid - skip_before_filter :check_user_profile + skip_before_action :check_user_agreements + skip_before_action :find_object_by_uuid + skip_before_action :check_user_profile + + def index + if unsigned_user_agreements.empty? + redirect_to(params[:return_to] || :back) + end + end def model_class Collection @@ -9,7 +19,7 @@ class UserAgreementsController < ApplicationController 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