Commit 1cefb73a authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg
parent a3b626bf
module ContinueToParams
extend ActiveSupport::Concern
def continue_params
continue_params = params[:continue]
return nil unless continue_params
continue_params = continue_params.permit(:to, :notice, :notice_now)
continue_params[:to] = root_url unless continue_params[:to].start_with?('/')
continue_params
end
end
class Projects::ForksController < Projects::ApplicationController
include ContinueToParams
# Authorize
before_action :require_non_empty_project
before_action :authorize_download_code!
......@@ -53,15 +55,4 @@ class Projects::ForksController < Projects::ApplicationController
render :error
end
end
private
def continue_params
continue_params = params[:continue]
if continue_params
continue_params.permit(:to, :notice, :notice_now)
else
nil
end
end
end
class Projects::ImportsController < Projects::ApplicationController
include ContinueToParams
# Authorize
before_action :authorize_admin_project!
before_action :require_no_repo, only: [:new, :create]
......@@ -44,16 +46,6 @@ class Projects::ImportsController < Projects::ApplicationController
private
def continue_params
continue_params = params[:continue]
if continue_params
continue_params.permit(:to, :notice, :notice_now)
else
nil
end
end
def finished_notice
if @project.forked?
'The project was successfully forked.'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment