From 8a2a3798493a7b490a5bf8d6970e7ed1232d8fc3 Mon Sep 17 00:00:00 2001 From: Diego Calvo Date: Wed, 10 Mar 2021 15:06:09 +0100 Subject: [PATCH 1/2] track_user geo fix --- stats/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stats/views.py b/stats/views.py index 778d62e..a41ba3d 100644 --- a/stats/views.py +++ b/stats/views.py @@ -58,7 +58,7 @@ def track_user(request): 'user': None if request.user.is_anonymous else request.user, 'anonymous': request.user.is_anonymous, 'ip_address': data.get('ip'), - 'geo': Point(data.get('geo')), + 'geo': Point(data.get('geo')['latitude'], data.get('geo')['longitude']), } if data['action_object'].get('model') == 'product': From 5c039f5ff28083d801b27580d2f28c9ba4e887f3 Mon Sep 17 00:00:00 2001 From: Diego Calvo Date: Thu, 11 Mar 2021 08:36:31 +0100 Subject: [PATCH 2/2] price filter add equal to --- products/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/utils.py b/products/utils.py index 05ebadf..b938a56 100644 --- a/products/utils.py +++ b/products/utils.py @@ -163,9 +163,9 @@ def find_related_products_v6(keyword, shipping_cost=None, discount=None, categor # filter by price if price_min is not None: - products_qs = products_qs.filter(price__gt=price_min) + products_qs = products_qs.filter(price__gte=price_min) if price_max is not None: - products_qs = products_qs.filter(price__lt=price_max) + products_qs = products_qs.filter(price__lte=price_max) # get min_price and max_price min_price = products_qs.aggregate(Min('price'))