fix a bug that can break password prompting in certain scenarios

see: https://github.com/ansible/awx/issues/8202
This commit is contained in:
Ryan Petrello
2020-09-28 15:50:45 -04:00
parent d6201d9eb6
commit c52054951d
2 changed files with 69 additions and 1 deletions

View File

@@ -4157,7 +4157,10 @@ class JobLaunchSerializer(BaseSerializer):
# verify that credentials (either provided or existing) don't
# require launch-time passwords that have not been provided
if 'credentials' in accepted:
launch_credentials = accepted['credentials']
launch_credentials = Credential.unique_dict(
list(template_credentials.all()) +
list(accepted['credentials'])
).values()
else:
launch_credentials = template_credentials
passwords = attrs.get('credential_passwords', {}) # get from original attrs