Fixed broken link on startpage for non ordergroup members.

This commit is contained in:
Benjamin Meichsner 2009-08-04 13:05:37 +02:00
parent ce375e1637
commit 116b1c4ed9

View file

@ -35,6 +35,8 @@ class HomeController < ApplicationController
def ordergroup def ordergroup
@user = @current_user @user = @current_user
@ordergroup = @user.ordergroup @ordergroup = @user.ordergroup
unless @ordergroup.nil?
@ordergroup_column_names = ["Description", "Actual Size", "Balance", "Updated"] @ordergroup_column_names = ["Description", "Actual Size", "Balance", "Updated"]
@ordergroup_columns = ["description", "account_balance", "account_updated"] @ordergroup_columns = ["description", "account_balance", "account_updated"]
@ -65,6 +67,10 @@ class HomeController < ApplicationController
format.html # myOrdergroup.haml format.html # myOrdergroup.haml
format.js { render :partial => "finance/transactions/list" } format.js { render :partial => "finance/transactions/list" }
end end
else
flash[:error] = "Leider bist Du kein Mitglied einer Bestellgruppe"
redirect_to root_path
end
end end
# cancel personal memberships direct from the myProfile-page # cancel personal memberships direct from the myProfile-page