From fdbadf967e4541a8933aeb3fc264b354ea89212b Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Thu, 27 Apr 2017 10:16:29 +0100 Subject: [PATCH] Fix the email billing data when there is no results. --- app/dao/notification_usage_dao.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/dao/notification_usage_dao.py b/app/dao/notification_usage_dao.py index 7d9d5e1d0..e07f575e0 100644 --- a/app/dao/notification_usage_dao.py +++ b/app/dao/notification_usage_dao.py @@ -56,8 +56,10 @@ def email_billing_data_query(service_id, start_date, end_date): NotificationHistory.international, NotificationHistory.phone_prefix ).first() - - return tuple(result) + (0,) + if not result: + return 0, EMAIL_TYPE, None, False, None, 0 + else: + return tuple(result) + (0,) def sms_billing_data_query(rate, service_id, start_date, end_date):