Skip to content
Snippets Groups Projects
Commit 3e94259e authored by inso's avatar inso
Browse files

Fixed bugs with account management

- Deleting the default account no longer tries to load it at the beginning
- Fixed the account name check with account import
parent 42d7cd1e
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,8 @@ class Application(QObject):
self.accounts.pop(account.name)
if self.current_account == account:
self.current_account = None
with open(config.parameters['data'], 'w') as outfile:
json.dump(self.jsonify(), outfile, indent=4, sort_keys=True)
def change_current_account(self, account):
'''
......
......@@ -58,7 +58,7 @@ class ImportAccountDialog(QDialog, Ui_ImportAccountDialog):
self.label_errors.setText("Please enter a name")
return
for account in self.app.accounts:
if name == account.name:
if name == account:
self.button_box.button(QDialogButtonBox.Ok).setEnabled(False)
self.label_errors.setText("Name already exists")
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment