From 13c05c68fc282765055145549543c79c9a7da67f Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 27 Feb 2019 16:43:25 -0500 Subject: [PATCH] fix a few additional py3 issues related: https://github.com/ansible/awx/issues/3329 --- awx/api/metadata.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/awx/api/metadata.py b/awx/api/metadata.py index 920bddd1ff..3f7ff7ea0b 100644 --- a/awx/api/metadata.py +++ b/awx/api/metadata.py @@ -238,12 +238,10 @@ class JobTypeMetadata(Metadata): res = super(JobTypeMetadata, self).get_field_info(field) if field.field_name == 'job_type': - index = 0 - for choice in res['choices']: - if choice[0] == 'scan': - res['choices'].pop(index) - break - index += 1 + res['choices'] = [ + choice for choice in res['choices'] + if choice[0] != 'scan' + ] return res @@ -253,7 +251,7 @@ class SublistAttachDetatchMetadata(Metadata): actions = super(SublistAttachDetatchMetadata, self).determine_actions(request, view) method = 'POST' if method in actions: - for field in actions[method]: + for field in list(actions[method].keys()): if field == 'id': continue actions[method].pop(field)