fix an unbound variable

see: https://github.com/ansible/awx/issues/2642j
This commit is contained in:
Ryan Petrello 2018-11-08 15:14:07 -05:00
parent 6a8454f748
commit 10667fc855
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -343,8 +343,8 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio
validated_kwargs = kwargs.copy()
if unallowed_fields:
if parent_field_name is None:
logger.warn(six.text_type('Fields {} are not allowed as overrides to spawn {} from {}.').format(
six.text_type(', ').join(unallowed_fields), unified_job, self
logger.warn(six.text_type('Fields {} are not allowed as overrides to spawn from {}.').format(
six.text_type(', ').join(unallowed_fields), self
))
map(validated_kwargs.pop, unallowed_fields)