Fix the email billing data when there is no results.

This commit is contained in:
Rebecca Law
2017-04-27 10:16:29 +01:00
committed by Ken Tsang
parent a186fc95be
commit fdbadf967e

View File

@@ -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):