Skip to content

Commit

Permalink
refs #124: add redirect to valid conference home for crew members
Browse files Browse the repository at this point in the history
  • Loading branch information
manno committed Mar 20, 2014
1 parent cad1296 commit 5e588b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ def index
return redirect_to new_conference_path
end
if cannot? :read, Conference
# maybe a crew user tries to login to the wrong conference?
if current_user.is_crew?
conference = current_user.conference_users.map { |cu| cu.conference }.last
return redirect_to conference_home_path(conference_acronym: conference.acronym) if conference.present?
end
return redirect_to cfp_root_path
end
@versions = Version.where(conference_id: @conference.id).includes(:item).order("created_at DESC").limit(5)
Expand Down

0 comments on commit 5e588b6

Please sign in to comment.