small fixes
This commit is contained in:
@@ -295,6 +295,7 @@ class CompanyViewSetTest(APITestCase):
|
|||||||
|
|
||||||
# TODO: test email_manager action
|
# TODO: test email_manager action
|
||||||
|
|
||||||
|
|
||||||
class MyCompanyViewTest(APITestCase):
|
class MyCompanyViewTest(APITestCase):
|
||||||
"""CompanyViewset tests
|
"""CompanyViewset tests
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ class CategoryTagAutocomplete(autocomplete.Select2QuerySetView):
|
|||||||
def purchase_email(request):
|
def purchase_email(request):
|
||||||
"""Notify coop manager and user about item purchase
|
"""Notify coop manager and user about item purchase
|
||||||
"""
|
"""
|
||||||
data = json.loads(request.body)
|
data = request.data
|
||||||
# check data
|
# check data
|
||||||
if request.user.is_anonymous and 'email' not in 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)
|
return Response({"error": "Anonymous users must include an email parameter value"}, status=status.HTTP_406_NOT_ACCEPTABLE)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def track_user(request):
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
data = json.loads(request.body)
|
data = request.data
|
||||||
|
|
||||||
if data.get('geo'):
|
if data.get('geo'):
|
||||||
coordinates = (data['geo'].get('latitude'), data['geo'].get('longitude'))
|
coordinates = (data['geo'].get('latitude'), data['geo'].get('longitude'))
|
||||||
|
|||||||
Reference in New Issue
Block a user