Another unicode -> str bug (#1194)

This commit is contained in:
Dmitri Bogomolov 2018-03-30 16:15:50 +03:00
parent 5e0e1c09b3
commit 6eb2155497
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
1 changed files with 3 additions and 2 deletions

View File

@ -233,8 +233,9 @@ class Ui_AddressWidget(BMTreeWidgetItem, SettingsMixin):
and self.type != AccountMixin.SUBSCRIPTION:
BMConfigParser().set(
str(self.address), 'label',
str(value).toString().toUtf8()
if isinstance(value, QtCore.QVariant) else str(value)
str(value.toString().toUtf8())
if isinstance(value, QtCore.QVariant)
else value.encode('utf-8')
)
BMConfigParser().save()
return super(Ui_AddressWidget, self).setData(column, role, value)