From aac2c5777ec82321d741b653f20440f84da9fcb1 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 17 Mar 2021 10:16:31 +0000 Subject: [PATCH] small fixes --- companies/tests.py | 1 + products/views.py | 2 +- stats/views.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/companies/tests.py b/companies/tests.py index 1ad084f..5ecc22b 100644 --- a/companies/tests.py +++ b/companies/tests.py @@ -295,6 +295,7 @@ class CompanyViewSetTest(APITestCase): # TODO: test email_manager action + class MyCompanyViewTest(APITestCase): """CompanyViewset tests """ diff --git a/products/views.py b/products/views.py index f80edbe..b824c5e 100644 --- a/products/views.py +++ b/products/views.py @@ -254,7 +254,7 @@ class CategoryTagAutocomplete(autocomplete.Select2QuerySetView): def purchase_email(request): """Notify coop manager and user about item purchase """ - data = json.loads(request.body) + data = request.data # check data if request.user.is_anonymous and 'email' not in data: return Response({"error": "Anonymous users must include an email parameter value"}, status=status.HTTP_406_NOT_ACCEPTABLE) diff --git a/stats/views.py b/stats/views.py index a11193e..1e30929 100644 --- a/stats/views.py +++ b/stats/views.py @@ -50,7 +50,7 @@ def track_user(request): } """ try: - data = json.loads(request.body) + data = request.data if data.get('geo'): coordinates = (data['geo'].get('latitude'), data['geo'].get('longitude'))