mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
Merge pull request #5333 from AlanCoding/jt_related_search
Surface labels related search for job templates
This commit is contained in:
commit
42184d2416
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user