mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
surface labels related search for job templates
This commit is contained in:
@@ -285,7 +285,11 @@ class ListAPIView(generics.ListAPIView, GenericAPIView):
|
||||
if name.endswith('_set'):
|
||||
continue
|
||||
fields.append('{}__search'.format(name))
|
||||
for relationship in self.model._meta.local_many_to_many:
|
||||
m2m_rel = []
|
||||
m2m_rel += self.model._meta.local_many_to_many
|
||||
if issubclass(self.model, UnifiedJobTemplate):
|
||||
m2m_rel += UnifiedJobTemplate._meta.local_many_to_many
|
||||
for relationship in m2m_rel:
|
||||
if relationship.related_model._meta.app_label != 'main':
|
||||
continue
|
||||
fields.append('{}__search'.format(relationship.name))
|
||||
|
||||
Reference in New Issue
Block a user