Expose the EE resolver to the job template detail API endpoints

This commit is contained in:
Jeff Bradberry
2021-06-01 11:34:50 -04:00
parent 30b7535ca2
commit d0991bab9e
2 changed files with 16 additions and 3 deletions

View File

@@ -477,11 +477,11 @@ class ExecutionEnvironmentMixin(models.Model):
if wf_template.execution_environment is not None:
return wf_template.execution_environment
wf_node = getattr(wf_node.workflow_job, 'unified_job_node', None)
if getattr(self, 'project', None) and self.project.default_environment is not None:
if getattr(self, 'project_id', None) and self.project.default_environment is not None:
return self.project.default_environment
if getattr(self, 'organization', None) and self.organization.default_environment is not None:
if getattr(self, 'organization_id', None) and self.organization.default_environment is not None:
return self.organization.default_environment
if getattr(self, 'inventory', None) and self.inventory.organization is not None:
if getattr(self, 'inventory_id', None) and self.inventory.organization is not None:
if self.inventory.organization.default_environment is not None:
return self.inventory.organization.default_environment