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:
parent
6578c4ed26
commit
683e44f30e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user