use credential input access methods in views/__init__.py

This commit is contained in:
Jake McDermott 2019-01-17 20:15:04 -05:00
parent 5010e98b8f
commit 3a58a5b772
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7

View File

@ -70,7 +70,6 @@ from awx.main.models import * # noqa
from awx.main.utils import * # noqa
from awx.main.utils import (
extract_ansible_vars,
decrypt_field,
)
from awx.main.utils.encryption import encrypt_value
from awx.main.utils.filters import SmartFilter
@ -1592,7 +1591,7 @@ class HostInsights(GenericAPIView):
serializer_class = EmptySerializer
def _extract_insights_creds(self, credential):
return (credential.inputs['username'], decrypt_field(credential, 'password'))
return (credential.get_input('username', default=''), credential.get_input('password', default=''))
def _get_insights(self, url, username, password):
session = requests.Session()