Skip to content

Commit

Permalink
Refs #RHIROS-1266 - fix condition to use group query
Browse files Browse the repository at this point in the history
  • Loading branch information
upadhyeammit committed Aug 24, 2023
1 parent 27d85b5 commit 4e4c259
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ros/api/common/add_group_filter.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from ros.lib.models import System
from flask_restful import request
from flask import request


def group_filtered_query(query):
if hasattr(request, "host_groups"):
host_groups = [gid for gid in request.host_groups if gid is not None]
if len(host_groups) > 1:
if len(host_groups) >= 1:
query = query.filter(System.groups[0]['id'].astext.in_(host_groups) | (System.groups == '[]'))
else:
query = query.filter((System.groups == '[]'))
Expand Down

0 comments on commit 4e4c259

Please sign in to comment.