do not fail on political group being unicode

This commit is contained in:
Frédéric Péters 2012-09-14 13:48:51 +02:00
parent 1d6e6b680a
commit 3db3267c5c
1 changed files with 4 additions and 1 deletions

View File

@ -355,7 +355,10 @@ class CsvView(BrowserView):
else:
row.append(None)
if object.polgroup:
row.append(object.polgroup.to_object.title)
polgroup_name = object.polgroup.to_object.title
if type(polgroup_name) is unicode:
polgroup_name = polgroup_name.encode('utf-8')
row.append(polgroup_name)
else:
row.append(None)
row.extend(address_as_csv(object.private_address))