Commit a7087cb9 authored by Valery Sizov's avatar Valery Sizov

HTTP_REFERER not properly set in Safari

parent 6b028ed8
...@@ -38,7 +38,7 @@ class Groups::HooksController < Groups::ApplicationController ...@@ -38,7 +38,7 @@ class Groups::HooksController < Groups::ApplicationController
flash[:alert] = 'Hook execution failed. Ensure the group has a project with commits.' flash[:alert] = 'Hook execution failed. Ensure the group has a project with commits.'
end end
redirect_to :back redirect_back_or_default(default: { action: 'index' })
end end
def destroy def destroy
......
...@@ -14,16 +14,19 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController ...@@ -14,16 +14,19 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController
if request.referer && request.referer.include?('admin') if request.referer && request.referer.include?('admin')
redirect_to [:admin, @group], notice: 'New LDAP link saved' redirect_to [:admin, @group], notice: 'New LDAP link saved'
else else
redirect_to :back, notice: 'New LDAP link saved' redirect_back_or_default(default: { action: 'index' }, options: { notice: 'New LDAP link saved' })
end end
else else
redirect_to :back, alert: "Could not create new LDAP link: #{ldap_group_link.errors.full_messages * ', '}" redirect_back_or_default(
default: { action: 'index' },
options: { alert: "Could not create new LDAP link: #{ldap_group_link.errors.full_messages * ', '}" }
)
end end
end end
def destroy def destroy
@group.ldap_group_links.where(id: params[:id]).destroy_all @group.ldap_group_links.where(id: params[:id]).destroy_all
redirect_to :back, notice: 'LDAP link removed' redirect_back_or_default(default: { action: 'index' }, options: { notice: 'LDAP link removed' })
end end
private private
......
...@@ -9,6 +9,6 @@ class Projects::ApproversController < ApplicationController ...@@ -9,6 +9,6 @@ class Projects::ApproversController < ApplicationController
project.approvers.find(params[:id]).destroy project.approvers.find(params[:id]).destroy
end end
redirect_to :back redirect_back_or_default(default: { action: 'index' })
end end
end end
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