Merge pull request #6923 from opf/fix/29193/redirect-back-projects-archive

[29193] Redirect back when archiving fails

[ci skip]
pull/6926/head
Oliver Günther 6 years ago committed by GitHub
commit 1fa9b190c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/controllers/projects_controller.rb

@ -190,8 +190,14 @@ class ProjectsController < ApplicationController
end
def archive
flash[:error] = l(:error_can_not_archive_project) unless @project.archive
redirect_to(url_for(controller: '/projects', action: 'index', status: params[:status]))
projects_url = url_for(controller: '/projects', action: 'index', status: params[:status])
if @project.archive
redirect_to projects_url
else
flash[:error] = I18n.t(:error_can_not_archive_project)
redirect_back fallback_location: projects_url
end
update_demo_project_settings @project, false
end

Loading…
Cancel
Save