mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
include playbook as a default search field
This commit is contained in:
parent
aaeb2d6fb9
commit
7d692d08f9
@ -223,7 +223,7 @@ class FieldLookupBackend(BaseFilterBackend):
|
||||
raise ValueError('%s is not searchable' % new_lookup[:-8])
|
||||
new_lookups = []
|
||||
for rm_field in related_model._meta.fields:
|
||||
if rm_field.name in ('username', 'first_name', 'last_name', 'email', 'name', 'description'):
|
||||
if rm_field.name in ('username', 'first_name', 'last_name', 'email', 'name', 'description', 'playbook'):
|
||||
new_lookups.append('{}__{}__icontains'.format(new_lookup[:-8], rm_field.name))
|
||||
return value, new_lookups
|
||||
else:
|
||||
|
||||
@ -4170,12 +4170,14 @@ class UnifiedJobTemplateList(ListAPIView):
|
||||
|
||||
model = models.UnifiedJobTemplate
|
||||
serializer_class = serializers.UnifiedJobTemplateSerializer
|
||||
search_fields = ('description', 'name', 'jobtemplate__playbook',)
|
||||
|
||||
|
||||
class UnifiedJobList(ListAPIView):
|
||||
|
||||
model = models.UnifiedJob
|
||||
serializer_class = serializers.UnifiedJobListSerializer
|
||||
search_fields = ('description', 'name', 'job__playbook',)
|
||||
|
||||
|
||||
def redact_ansi(line):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user