Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix tests

Pacu21ab344e7ab62
diff --git a/saleor/core/analytics.py b/saleor/core/analytics.py
index a74c8a59a4..03707ba500 100644
--- a/saleor/core/analytics.py
+++ b/saleor/core/analytics.py
@@ -1,9 +1,10 @@
+# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
-from django.conf import settings
import google_measurement_protocol as ga
+from django.conf import settings
FINGERPRINT_PARTS = [
'HTTP_ACCEPT_ENCODING',
@@ -17,7 +18,8 @@ UUID_NAMESPACE = uuid.UUID('fb4abc05-e2fb-4e3e-8b78-28037ef7d07f')
def get_client_id(request):
parts = [request.META.get(key, '') for key in FINGERPRINT_PARTS]
- return uuid.uuid5(UUID_NAMESPACE, '_'.join(parts))
+ encoded_parts = '_'.join(parts).encode('utf_8')
+ return uuid.uuid5(UUID_NAMESPACE, str(encoded_parts))
def _report(client_id, what, extra_info=None, extra_headers=None):