From b21d21de9c0d8545943ce596bd55e1a89fcbada6 Mon Sep 17 00:00:00 2001 From: Ilya Shakhat Date: Mon, 14 Oct 2013 19:45:50 +0400 Subject: [PATCH] Fixed failure on empty mention count during records processing Change-Id: I082d8e0a945640cda23a8a30765c684f62a9aad1 --- dashboard/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/web.py b/dashboard/web.py index 9024e44b8..150b28761 100644 --- a/dashboard/web.py +++ b/dashboard/web.py @@ -682,7 +682,7 @@ def get_activity_json(records): blueprint = record.copy() _extend_record(blueprint) blueprint['summary'] = utils.format_text(record['summary']) - if 'mention_date' in record: + if record.get('mention_count'): blueprint['mention_date_str'] = format_datetime( record['mention_date']) blueprint['blueprint_link'] = make_blueprint_link( @@ -813,7 +813,7 @@ def get_bpd(records): result.append({ 'date': format_date(record['date']), 'status': record['lifecycle_status'], - 'metric': record['mention_count'], + 'metric': record.get('mention_count') or 0, 'id': record['name'], 'name': record['name'], 'link': make_blueprint_link(record['name'], record['module'])