calculate stdout download length using the ORM, not raw SQL

This commit is contained in:
Ryan Petrello
2018-01-02 11:05:10 -05:00
parent 35b8e40d3c
commit 2bd656e61d
5 changed files with 33 additions and 10 deletions

View File

@@ -18,6 +18,7 @@ from django.utils.timezone import now, make_aware, get_default_timezone
# AWX
from awx.api.versioning import reverse
from awx.main.models.base import * # noqa
from awx.main.models.events import ProjectUpdateEvent
from awx.main.models.notifications import (
NotificationTemplate,
JobNotificationMixin,
@@ -485,6 +486,10 @@ class ProjectUpdate(UnifiedJob, ProjectOptions, JobNotificationMixin, TaskManage
websocket_data.update(dict(project_id=self.project.id))
return websocket_data
@property
def event_class(self):
return ProjectUpdateEvent
@property
def task_impact(self):
return 0 if self.job_type == 'run' else 20