Merge pull request #1321 from AlanCoding/magic_credential

Alias filters by credential to credentials
This commit is contained in:
Alan Rominger 2018-02-21 15:51:42 -05:00 committed by GitHub
commit 2ebee58727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -276,7 +276,7 @@ class FieldLookupBackend(BaseFilterBackend):
# TODO: remove after API v1 deprecation period
if queryset.model._meta.object_name in ('JobTemplate', 'Job') and key in (
'credential', 'vault_credential', 'cloud_credential', 'network_credential'
):
) or queryset.model._meta.object_name in ('InventorySource', 'InventoryUpdate') and key == 'credential':
key = 'credentials'
# Make legacy v1 Credential fields work for backwards compatability