Fix IntegrityError deleting job splitting JT

misc:
*show sharded jobs in recent_jobs
*test updates
This commit is contained in:
AlanCoding
2018-09-10 13:54:04 -04:00
parent f9bdb1da15
commit 7ff04dafd3
8 changed files with 61 additions and 20 deletions

View File

@@ -2976,12 +2976,9 @@ class JobTemplateMixin(object):
'''
def _recent_jobs(self, obj):
if hasattr(obj, 'workflow_jobs'):
job_mgr = obj.workflow_jobs
else:
job_mgr = obj.jobs
job_mgr = obj.unifiedjob_unified_jobs.non_polymorphic().only('id', 'status', 'finished')
return [{'id': x.id, 'status': x.status, 'finished': x.finished}
for x in job_mgr.all().order_by('-created')[:10]]
for x in job_mgr.order_by('-created')[:10]]
def get_summary_fields(self, obj):
d = super(JobTemplateMixin, self).get_summary_fields(obj)