diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 7fa39db6b..8bd517026 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -19,7 +19,7 @@ class Projects::IssuesController < Projects::BaseController @all_issues = all_issues @created_issues = all_issues.where(user_id: current_user) - @assigned_issues = all_issues.where(assignee_id: current_user.id) + @assigned_issues = all_issues.where(assignee_id: current_user) case params[:filter] when 'created' diff --git a/app/views/projects/issues/_filter.json.jbuilder b/app/views/projects/issues/_filter.json.jbuilder index 5072255cc..52f35498d 100644 --- a/app/views/projects/issues/_filter.json.jbuilder +++ b/app/views/projects/issues/_filter.json.jbuilder @@ -5,7 +5,7 @@ json.sort_direction params[:direction] json.status params[:status] json.all_count @all_issues.not_closed_or_merged.count -json.assigned_count @assigned_issues.not_closed_or_merged.count +json.assigned_count (current_user ? @assigned_issues.not_closed_or_merged.count : 0) json.created_count @created_issues.not_closed_or_merged.count json.opened_count @opened_issues.count json.closed_count @closed_issues.count