Fix batch row status breakdown, for rows with no status

This commit is contained in:
Lance Edgar 2018-09-20 18:22:36 -05:00
parent c3637bc416
commit fb3105c099

View file

@ -170,13 +170,14 @@ class BatchMasterView(MasterView):
"""
breakdown = {}
for row in batch.active_rows():
if row.status_code not in breakdown:
breakdown[row.status_code] = {
'code': row.status_code,
'title': row.STATUS[row.status_code],
'count': 0,
}
breakdown[row.status_code]['count'] += 1
if row.status_code is not None:
if row.status_code not in breakdown:
breakdown[row.status_code] = {
'code': row.status_code,
'title': row.STATUS[row.status_code],
'count': 0,
}
breakdown[row.status_code]['count'] += 1
breakdown = [
(status['title'], status['count'])
for code, status in six.iteritems(breakdown)]