Skip to content

Commit bb32146

Browse files
author
Rohan Bansal
committed
fix: py3 compatibility for insight engine
1 parent 687f8dd commit bb32146

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bloomstack_core/bloomstack_core/page/insight_engine/insight_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_top_products(start_date, end_date, limit=10):
137137

138138
for invoice in invoice_items_by_date:
139139
# Ensure only invoices with the requested dates get calculated
140-
if top_products_by_time_and_revenue.get(invoice.item, {}).has_key(invoice.date):
140+
if invoice.date in top_products_by_time_and_revenue.get(invoice.item, {}):
141141
top_products_by_time_and_revenue[invoice.item][invoice.date] += invoice.revenue
142142

143143
# NOTE: Doing dates.values() returns a list of values in an arbitrary order

0 commit comments

Comments
 (0)