From 1f8f51672720491c26a15333a8b7916b5936d0c2 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 24 May 2019 14:10:36 +0200 Subject: [PATCH] don't include admin account in provider list --- app/models/concerns/indexable.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/concerns/indexable.rb b/app/models/concerns/indexable.rb index 1111e9897..4b56732dd 100644 --- a/app/models/concerns/indexable.rb +++ b/app/models/concerns/indexable.rb @@ -166,6 +166,7 @@ def query(query, options={}) must << { term: { focus_area: options[:focus_area] }} if options[:focus_area].present? must_not << { exists: { field: "deleted_at" }} unless options[:include_deleted] + must_not << { term: { role_name: "ROLE_ADMIN" }} elsif self.name == "Client" must << { range: { created: { gte: "#{options[:year].split(",").min}||/y", lte: "#{options[:year].split(",").max}||/y", format: "yyyy" }}} if options[:year].present? must << { terms: { "software.raw" => options[:software].split(",") }} if options[:software].present?