Merge pull request #1549 from internetee/1535-fix-registrar-switching

Fix redirect back
This commit is contained in:
Timo Võhmar 2020-02-28 15:23:25 +02:00 committed by GitHub
commit 4165222da2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ module Admin
send_data @zonefile, filename: "#{params[:origin]}.txt" send_data @zonefile, filename: "#{params[:origin]}.txt"
else else
flash[:alert] = 'Origin not supported' flash[:alert] = 'Origin not supported'
redirect_to :back redirect_back(fallback_location: root_path)
end end
end end
end end

View file

@ -6,7 +6,7 @@ class Registrar
raise 'Cannot switch to unlinked user' unless current_registrar_user.linked_with?(new_user) raise 'Cannot switch to unlinked user' unless current_registrar_user.linked_with?(new_user)
sign_in(:registrar_user, new_user) sign_in(:registrar_user, new_user)
redirect_to :back, notice: t('.switched', new_user: new_user) redirect_back(fallback_location: root_path, notice: t('.switched', new_user: new_user))
end end
private private