block deletion of resources w unprocessed events

This commit is contained in:
AlanCoding
2018-03-15 15:56:52 -04:00
parent 16aa3d724f
commit 7881c921ac
9 changed files with 89 additions and 47 deletions

View File

@@ -457,8 +457,11 @@ class RelatedJobsMixin(object):
Returns a list of active jobs (i.e. running) associated with the calling
resource (self). Expected to return a QuerySet
'''
def _get_related_jobs(self):
return self.objects.none()
def _get_active_jobs(self):
return []
return self._get_related_jobs().filter(status__in=('new', 'pending', 'waiting', 'running'))
'''
Returns [{'id': '1', 'type': 'job'}, {'id': 2, 'type': 'project_update'}, ...]