From fb3105c099b4d8d8a729afde15ab6590f7009e28 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 20 Sep 2018 18:22:36 -0500 Subject: [PATCH] Fix batch row status breakdown, for rows with no status --- tailbone/views/batch/core.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index f29df6e3..402619b2 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -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)]