From a0d337e6d8fcd9036c5adf9beabb11509e00e149 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 4 Jun 2012 21:22:44 +0200 Subject: [PATCH] city values are unicode in django 1.4 --- pandora/user/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/user/models.py b/pandora/user/models.py index 29459b5bd..0b64f3c55 100644 --- a/pandora/user/models.py +++ b/pandora/user/models.py @@ -65,7 +65,9 @@ class SessionData(models.Model): if location: country = ox.get_country_name(location['country_code']) if location['city']: - city = location['city'].decode('latin-1') + city = location['city'] + if type(city) != unicode: + city = city.decode('latin-1') self.location = u'%s, %s' % (city, country) self.location_sort = u'%s, %s' % (country, city) else: