summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkazubu <kazubu@jtime.net>2015-10-26 14:58:09 +0900
committerkazubu <kazubu@jtime.net>2015-10-26 15:06:55 +0900
commit0bfb9cbf38c72f801255b910430fdbff6536b73d (patch)
tree07c813f4a9288819a991a3e500e74c0ee406d37f
parentc3d48f97355371d6c8760e05637f666f23c2a76a (diff)
downloadgitlab-ce-0bfb9cbf38c72f801255b910430fdbff6536b73d.tar.gz
modify to use redirect_back_or_default function
-rw-r--r--app/controllers/projects_controller.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 743c429b72e..05c7d3de8bc 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -124,11 +124,7 @@ class ProjectsController < ApplicationController
::Projects::DestroyService.new(@project, current_user, {}).execute
flash[:alert] = "Project '#{@project.name}' was deleted."
- if request.referer.present? && request.referer.include?('/admin')
- redirect_to admin_namespaces_projects_path
- else
- redirect_to dashboard_projects_path
- end
+ redirect_back_or_default(default: dashboard_projects_path, options: {})
rescue Projects::DestroyService::DestroyError => ex
redirect_to edit_project_path(@project), alert: ex.message
end