From 61134c2d68b09ac1b9b30eb04fd369f566707b70 Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Mon, 1 Jul 2019 11:35:48 +0200 Subject: [PATCH] use different methods for filtering drafts use different methods for filtering drafts --- app/controllers/clients_controller.rb | 2 +- app/controllers/providers_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb index 71551621c..951439357 100644 --- a/app/controllers/clients_controller.rb +++ b/app/controllers/clients_controller.rb @@ -145,7 +145,7 @@ def totals page = { size: 0, number: 1} response = nil bmt = Benchmark.ms { - state = authenticate_user!.present? && authenticate_user!.is_admin? && params[:state].present? ? params[:state] : "registered,findable" + state = current_user.present? && current_user.is_admin_or_staff? && params[:state].present? ? params[:state] : "registered,findable" response = Doi.query(nil, provider_id: params[:provider_id], state: state, page: page, totals_agg: true) } if bmt > 10000 diff --git a/app/controllers/providers_controller.rb b/app/controllers/providers_controller.rb index 5c6eadc2b..ca1c9c044 100644 --- a/app/controllers/providers_controller.rb +++ b/app/controllers/providers_controller.rb @@ -201,7 +201,7 @@ def totals page = { size: 0, number: 1 } response = nil bmt = Benchmark.ms { - state = authenticate_user!.present? && authenticate_user!.is_admin? && params[:state].present? ? params[:state] : "registered,findable" + state = current_user.present? && current_user.is_admin_or_staff? && params[:state].present? ? params[:state] : "registered,findable" response = Doi.query(nil, state: state, page: page, totals_agg: true) }