mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
Merge pull request #3761 from AlanCoding/proj_update_death
Hack and slash of project directory checks
This commit is contained in:
@@ -954,15 +954,6 @@ class ProjectList(ListCreateAPIView):
|
|||||||
)
|
)
|
||||||
return projects_qs
|
return projects_qs
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
|
||||||
# Not optimal, but make sure the project status and last_updated fields
|
|
||||||
# are up to date here...
|
|
||||||
projects_qs = Project.objects
|
|
||||||
projects_qs = projects_qs.select_related('current_job', 'last_job')
|
|
||||||
for project in projects_qs:
|
|
||||||
project._set_status_and_last_job_run()
|
|
||||||
return super(ProjectList, self).get(request, *args, **kwargs)
|
|
||||||
|
|
||||||
class ProjectDetail(RetrieveUpdateDestroyAPIView):
|
class ProjectDetail(RetrieveUpdateDestroyAPIView):
|
||||||
|
|
||||||
model = Project
|
model = Project
|
||||||
|
|||||||
@@ -318,10 +318,6 @@ class Project(UnifiedJobTemplate, ProjectOptions, ResourceMixin):
|
|||||||
# inherit the child job status on failure
|
# inherit the child job status on failure
|
||||||
elif self.last_job_failed:
|
elif self.last_job_failed:
|
||||||
return self.last_job.status
|
return self.last_job.status
|
||||||
# Even on a successful child run, a missing project path overides
|
|
||||||
# the successful status
|
|
||||||
elif not self.get_project_path():
|
|
||||||
return 'missing'
|
|
||||||
# Return the successful status
|
# Return the successful status
|
||||||
else:
|
else:
|
||||||
return self.last_job.status
|
return self.last_job.status
|
||||||
|
|||||||
Reference in New Issue
Block a user