mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 06:28:01 -03:30
Enable approval notifications to show up at...
...workflow jobs notifications endpoint
This commit is contained in:
parent
96689f45c8
commit
5aa6a94710
@ -489,9 +489,12 @@ class SubListAPIView(ParentMixin, ListAPIView):
|
||||
parent = self.get_parent_object()
|
||||
self.check_parent_access(parent)
|
||||
qs = self.request.user.get_queryset(self.model).distinct()
|
||||
sublist_qs = getattrd(parent, self.relationship).distinct()
|
||||
sublist_qs = self.get_sublist_queryset(parent)
|
||||
return qs & sublist_qs
|
||||
|
||||
def get_sublist_queryset(self, parent):
|
||||
return getattrd(parent, self.relationship).distinct()
|
||||
|
||||
|
||||
class DestroyAPIView(generics.DestroyAPIView):
|
||||
|
||||
|
||||
@ -3379,6 +3379,11 @@ class WorkflowJobNotificationsList(SubListAPIView):
|
||||
relationship = 'notifications'
|
||||
search_fields = ('subject', 'notification_type', 'body',)
|
||||
|
||||
def get_sublist_queryset(self, parent):
|
||||
return self.model.objects.filter(Q(unifiedjob_notifications=parent) |
|
||||
Q(unifiedjob_notifications__unified_job_node__workflow_job=parent,
|
||||
unifiedjob_notifications__workflowapproval__isnull=False)).distinct()
|
||||
|
||||
|
||||
class WorkflowJobActivityStreamList(SubListAPIView):
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user