Use the proper queryset to filter project update events (#14166)

This commit is contained in:
Alan Rominger 2023-06-26 21:41:08 -04:00 committed by GitHub
parent fe2da52eec
commit aed96fb365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1629,8 +1629,8 @@ class ProjectUpdateDetailSerializer(ProjectUpdateSerializer):
fields = ('*', 'host_status_counts', 'playbook_counts')
def get_playbook_counts(self, obj):
task_count = obj.project_update_events.filter(event='playbook_on_task_start').count()
play_count = obj.project_update_events.filter(event='playbook_on_play_start').count()
task_count = obj.get_event_queryset().filter(event='playbook_on_task_start').count()
play_count = obj.get_event_queryset().filter(event='playbook_on_play_start').count()
data = {'play_count': play_count, 'task_count': task_count}