diff options
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index b46ec5e5350..493e7985d75 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -374,19 +374,14 @@ class IssuableFinder end def by_label(items) - if labels? + return items unless labels? + + items = if filter_by_no_label? - items = items.without_label + items.without_label else - items = items.with_label(label_names, params[:sort]) - items_projects = projects(items) - - if items_projects - label_ids = LabelsFinder.new(current_user, project_ids: items_projects).execute(skip_authorization: true).select(:id) - items = items.where(labels: { id: label_ids }) - end + items.with_label(label_names, params[:sort]) end - end items end |