Fix batch row status breakdown, for rows with no status
This commit is contained in:
parent
c3637bc416
commit
fb3105c099
|
@ -170,13 +170,14 @@ class BatchMasterView(MasterView):
|
||||||
"""
|
"""
|
||||||
breakdown = {}
|
breakdown = {}
|
||||||
for row in batch.active_rows():
|
for row in batch.active_rows():
|
||||||
if row.status_code not in breakdown:
|
if row.status_code is not None:
|
||||||
breakdown[row.status_code] = {
|
if row.status_code not in breakdown:
|
||||||
'code': row.status_code,
|
breakdown[row.status_code] = {
|
||||||
'title': row.STATUS[row.status_code],
|
'code': row.status_code,
|
||||||
'count': 0,
|
'title': row.STATUS[row.status_code],
|
||||||
}
|
'count': 0,
|
||||||
breakdown[row.status_code]['count'] += 1
|
}
|
||||||
|
breakdown[row.status_code]['count'] += 1
|
||||||
breakdown = [
|
breakdown = [
|
||||||
(status['title'], status['count'])
|
(status['title'], status['count'])
|
||||||
for code, status in six.iteritems(breakdown)]
|
for code, status in six.iteritems(breakdown)]
|
||||||
|
|
Loading…
Reference in a new issue