From a175238d09c4b6858cadb6673a47c53b5679d415 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 19 Apr 2017 16:34:34 +0200 Subject: [PATCH] fix geo lookup in python3, fixes #3019 --- pandora/user/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/user/models.py b/pandora/user/models.py index 5ce7000e9..1d86b8080 100644 --- a/pandora/user/models.py +++ b/pandora/user/models.py @@ -78,7 +78,7 @@ class SessionData(models.Model): country = ox.get_country_name(location['country_code']) if location['city']: city = location['city'] - if type(city) != unicode: + if isinstance(city, bytes): city = city.decode('latin-1') self.location = u'%s, %s' % (city, country) self.location_sort = u'%s, %s' % (country, city)