1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Check for attributes on the job template before attempting to use that

This commit is contained in:
Matthew Jones 2014-12-01 10:50:49 -05:00
parent 6578c4ed26
commit 683e44f30e

View File

@ -303,6 +303,8 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique):
if hasattr(self, '%s_id' % field_name) and ('%s_id' % field_name) in kwargs:
create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs["%s_id" % field_name]
continue
if not hasattr(self, field_name):
continue
create_kwargs[field_name] = getattr(self, field_name)
kwargs = self._update_unified_job_kwargs(**create_kwargs)
unified_job = unified_job_class(**create_kwargs)