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

View File

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