From c6788e2f40f0b45ff19bf48d3c3a87b2402c6274 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 7 Mar 2015 15:30:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- lib/redmine/activity/fetcher.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5e2f76705..48c08e2fc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -447,7 +447,7 @@ class UsersController < ApplicationController activity = activity.reject { |e| !User.current.admin? && (((e.act_type == "Issue") && !e.act.project.visible?(User.current)) || - (e.act_type == "Bid" && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) || + (e.act_type == "Bid" && !e.act.courses.first.nil? && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) || (e.act_type == "Journal" && e.act.respond_to?("Project") && !e.act.project.visible?(User.current)) || (e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) || (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course))))) diff --git a/lib/redmine/activity/fetcher.rb b/lib/redmine/activity/fetcher.rb index c4adc6adb..5f811f8d4 100644 --- a/lib/redmine/activity/fetcher.rb +++ b/lib/redmine/activity/fetcher.rb @@ -119,7 +119,7 @@ module Redmine #else # e += [cur_obj] #end - if cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == true + if cur_obj.project.respond_to?("Project") && cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == true e += [cur_obj] #else # e += [cur_obj]