Fix implicit call to unicode() from UI functions

BaseFolder now exposes an __unicode__ method so that function needing
unicode transcoding don't crash due to ascii encoding errors.

Signed-off-by: Stéphane Albert <sheeprine@oh.its.fake.nullplace.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Stéphane Albert 2016-09-23 15:48:55 +02:00 committed by Nicolas Sebrecht
parent c0f4fa44eb
commit 57e6eda617

View File

@ -98,6 +98,11 @@ class BaseFolder(object):
# FIMXE: remove calls of this. We have getname().
return self.name
def __unicode__(self):
# NOTE(sheeprine): Implicit call to this by UIBase deletingflags() which
# fails if the str is utf-8
return self.name.decode('utf-8')
@property
def accountname(self):
"""Account name as string"""