Skip to content
Snippets Groups Projects
Commit 25fa9bd9 authored by Vermaat's avatar Vermaat
Browse files

Merge pull request #106 from mutalyzer/fix-admin-batch-jobs

Fix crash listing zero batch jobs in admin
parents afa9ded0 a9e69782
No related branches found
No related tags found
No related merge requests found
...@@ -176,6 +176,9 @@ def list_batch_jobs(): ...@@ -176,6 +176,9 @@ def list_batch_jobs():
).label('count') ).label('count')
).order_by(BatchJob.added.asc()).all() ).order_by(BatchJob.added.asc()).all()
if len(batch_jobs_with_counts) < 1:
return
lengths = { lengths = {
'id_len': max(len(str(j.id)) for j, _ in batch_jobs_with_counts), 'id_len': max(len(str(j.id)) for j, _ in batch_jobs_with_counts),
'type_len': max(len(j.job_type) for j, _ in batch_jobs_with_counts), 'type_len': max(len(j.job_type) for j, _ in batch_jobs_with_counts),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment