mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 07:28:02 -03:30
Merge pull request #3802 from AlanCoding/playbook_search
Include playbook as a default search field Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
72fe6e400e
@ -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:
|
||||
|
||||
@ -4176,12 +4176,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