mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
Putting back the inadvertantly removed job_events
This commit is contained in:
@@ -204,6 +204,7 @@ job_urls = patterns('awx.api.views',
|
|||||||
url(r'^(?P<pk>[0-9]+)/cancel/$', 'job_cancel'),
|
url(r'^(?P<pk>[0-9]+)/cancel/$', 'job_cancel'),
|
||||||
url(r'^(?P<pk>[0-9]+)/relaunch/$', 'job_relaunch'),
|
url(r'^(?P<pk>[0-9]+)/relaunch/$', 'job_relaunch'),
|
||||||
url(r'^(?P<pk>[0-9]+)/job_host_summaries/$', 'job_job_host_summaries_list'),
|
url(r'^(?P<pk>[0-9]+)/job_host_summaries/$', 'job_job_host_summaries_list'),
|
||||||
|
url(r'^(?P<pk>[0-9]+)/job_events/$', 'job_job_events_list'),
|
||||||
url(r'^(?P<pk>[0-9]+)/activity_stream/$', 'job_activity_stream_list'),
|
url(r'^(?P<pk>[0-9]+)/activity_stream/$', 'job_activity_stream_list'),
|
||||||
url(r'^(?P<pk>[0-9]+)/stdout/$', 'job_stdout'),
|
url(r'^(?P<pk>[0-9]+)/stdout/$', 'job_stdout'),
|
||||||
url(r'^(?P<pk>[0-9]+)/notifications/$', 'job_notifications_list'),
|
url(r'^(?P<pk>[0-9]+)/notifications/$', 'job_notifications_list'),
|
||||||
|
|||||||
@@ -3473,6 +3473,22 @@ class GroupJobEventsList(BaseJobEventsList):
|
|||||||
parent_model = Group
|
parent_model = Group
|
||||||
|
|
||||||
|
|
||||||
|
class JobJobEventsList(BaseJobEventsList):
|
||||||
|
|
||||||
|
parent_model = Job
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
job = self.get_parent_object()
|
||||||
|
self.check_parent_access(job)
|
||||||
|
qs = job.job_events.all()
|
||||||
|
qs = qs.select_related('host')
|
||||||
|
qs = qs.prefetch_related('hosts', 'children')
|
||||||
|
if self.request.user.is_superuser or self.request.user.is_system_auditor:
|
||||||
|
return qs.all()
|
||||||
|
host_qs = self.request.user.get_queryset(Host)
|
||||||
|
return qs.filter(Q(host__isnull=True) | Q(host__in=host_qs))
|
||||||
|
|
||||||
|
|
||||||
class AdHocCommandList(ListCreateAPIView):
|
class AdHocCommandList(ListCreateAPIView):
|
||||||
|
|
||||||
model = AdHocCommand
|
model = AdHocCommand
|
||||||
|
|||||||
Reference in New Issue
Block a user