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