mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-16 03:02:26 +03:00
fix utf-8 account names
This commit is contained in:
parent
f39a9d65eb
commit
574642a0e7
@ -81,7 +81,7 @@ class Ui_AddAccount(QtGui.QDialog):
|
|||||||
self.label_3.setText("Secret Key")
|
self.label_3.setText("Secret Key")
|
||||||
|
|
||||||
#set place holder text
|
#set place holder text
|
||||||
self.lineEdit.setPlaceholderText("tom@example.com")
|
self.lineEdit.setPlaceholderText("johndoe@example.com")
|
||||||
self.lineEdit_2.setPlaceholderText("thei ncre dibl ehul kisi nmod hex!")
|
self.lineEdit_2.setPlaceholderText("thei ncre dibl ehul kisi nmod hex!")
|
||||||
# set modal option
|
# set modal option
|
||||||
self.setModal(True)
|
self.setModal(True)
|
||||||
@ -91,7 +91,7 @@ class Ui_AddAccount(QtGui.QDialog):
|
|||||||
def verify(self):
|
def verify(self):
|
||||||
#set the data and quit
|
#set the data and quit
|
||||||
# WARNING THE lineEdit.text() RETURNS A UNICODE
|
# WARNING THE lineEdit.text() RETURNS A UNICODE
|
||||||
self.new_account['ACCOUNT_NAME'] = self.lineEdit.text().encode('utf-8')
|
self.new_account['ACCOUNT_NAME'] = self.lineEdit.text().encode('utf-8').strip()
|
||||||
#remove whitespace
|
#remove whitespace
|
||||||
self.new_account['SECRET_KEY'] = self.lineEdit_2.text().replace(" ", "")
|
self.new_account['SECRET_KEY'] = self.lineEdit_2.text().replace(" ", "")
|
||||||
|
|
||||||
|
@ -268,11 +268,11 @@ class Ui_Dialog(object):
|
|||||||
|
|
||||||
for credential in cred_list:
|
for credential in cred_list:
|
||||||
if credential.algorithm == 'totp':
|
if credential.algorithm == 'totp':
|
||||||
self.leftList.addItem(str(credential.name))
|
self.leftList.addItem(str(credential.name).decode('utf-8').strip())
|
||||||
self.rightList.addItem(str(credential.code))
|
self.rightList.addItem(str(credential.code))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.leftList.addItem(str(credential.name))
|
self.leftList.addItem(str(credential.name).decode('utf-8').strip())
|
||||||
|
|
||||||
self.rightList.addItem('HOTP')
|
self.rightList.addItem('HOTP')
|
||||||
#identify the row and set the tooltip
|
#identify the row and set the tooltip
|
||||||
@ -299,6 +299,7 @@ class Ui_Dialog(object):
|
|||||||
#strip off white spaces
|
#strip off white spaces
|
||||||
new_account['ACCOUNT_NAME'].replace(" ", "")
|
new_account['ACCOUNT_NAME'].replace(" ", "")
|
||||||
new_account['SECRET_KEY'].replace(" ", "")
|
new_account['SECRET_KEY'].replace(" ", "")
|
||||||
|
#new_account['ACCOUNT_NAME'] = str(new_account['ACCOUNT_NAME']).encode("utf-8").strip()
|
||||||
#run the PUT command
|
#run the PUT command
|
||||||
yc.execute_command("put", new_account)
|
yc.execute_command("put", new_account)
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
Loading…
Reference in New Issue
Block a user