do not redirect admin to his profile upon sign in

This commit is contained in:
Jonne Haß 2012-09-14 15:01:19 +02:00
parent ca1cc8c5f5
commit 4bada36bf1
2 changed files with 2 additions and 13 deletions

View file

@ -4,12 +4,8 @@
class HomeController < ApplicationController class HomeController < ApplicationController
def show def show
if current_user if user_signed_in?
if current_user.admin?
redirect_to person_path(current_user.person)
else
redirect_to stream_path redirect_to stream_path
end
elsif is_mobile_device? elsif is_mobile_device?
unless(File.exist?(Rails.root.join('app', 'views', 'home', '_show.mobile.erb'))) unless(File.exist?(Rails.root.join('app', 'views', 'home', '_show.mobile.erb')))
redirect_to user_session_path redirect_to user_session_path

View file

@ -21,13 +21,6 @@ describe HomeController do
get :show, :home => true get :show, :home => true
response.should redirect_to(stream_path) response.should redirect_to(stream_path)
end end
it "points to a user's profile page if a user is an admin without contacts" do
alice.contacts.destroy_all
Role.add_admin(alice.person)
get :show, :home => true
response.should redirect_to(person_path(alice.person))
end
end end
end end