visualization: do not match null warehouse_slug (#39482)

This commit is contained in:
Benjamin Dauvergne 2020-02-03 14:11:25 +01:00
parent 76ef3b2fde
commit edb19179d3
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ class Visualization(object):
if not warehouses:
warehouses = get_warehouses()
for warehouse in warehouses:
if warehouse.slug and 'warehouse_slug' in d:
if warehouse.slug and d.get('warehouse_slug'):
if d['warehouse_slug'] == warehouse.slug:
break
elif d['warehouse'] == warehouse.name: # legacy