mirror of
https://github.com/ansible/awx.git
synced 2026-04-29 05:35:27 -02:30
AC-990 Make job event filtering by host work even when not capturing hosts M2M. Also fix unit tests to skip checking hosts M2M.
This commit is contained in:
@@ -118,6 +118,12 @@ class FieldLookupBackend(BaseFilterBackend):
|
||||
for key, values in request.QUERY_PARAMS.lists():
|
||||
if key in self.RESERVED_NAMES:
|
||||
continue
|
||||
|
||||
# HACK: Make job event filtering by host name mostly work even
|
||||
# when not capturing job event hosts M2M.
|
||||
if queryset.model._meta.object_name == 'JobEvent' and key.startswith('hosts__name'):
|
||||
key = key.replace('hosts__name', 'or__host__name')
|
||||
or_filters.append((False, 'host__name__isnull', True))
|
||||
|
||||
# Custom __int filter suffix (internal use only).
|
||||
q_int = False
|
||||
|
||||
Reference in New Issue
Block a user