From 9ea1ab90b4705ef4d5ce37ded36a214f276c0a18 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 31 Mar 2013 18:32:13 +0200 Subject: add and delete accounts, db will be resetted --- module/api/AccountApi.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/api/AccountApi.py') diff --git a/module/api/AccountApi.py b/module/api/AccountApi.py index d1586e7aa..981842b5c 100644 --- a/module/api/AccountApi.py +++ b/module/api/AccountApi.py @@ -19,7 +19,7 @@ class AccountApi(ApiComponent): accs = self.core.accountManager.getAllAccounts(refresh) accounts = [] for plugin in accs.itervalues(): - accounts.extend(plugin.values()) + accounts.extend([acc.toInfoData() for acc in plugin.values()]) return accounts @@ -32,9 +32,10 @@ class AccountApi(ApiComponent): return self.core.pluginManager.getPlugins("accounts").keys() @RequirePerm(Permission.Accounts) - def updateAccount(self, plugin, account, password=None, options={}): + def updateAccount(self, plugin, login, password): """Changes pw/options for specific account.""" - self.core.accountManager.updateAccount(plugin, account, password, options) + # TODO: options + self.core.accountManager.updateAccount(plugin, login, password, {}) def updateAccountInfo(self, account): """ Update account from :class:`AccountInfo` """ @@ -46,8 +47,7 @@ class AccountApi(ApiComponent): :param account: :class:`ÀccountInfo` instance """ - # TODO - self.core.accountManager.removeAccount(plugin, account) + self.core.accountManager.removeAccount(account.plugin, account.loginname) if Api.extend(AccountApi): -- cgit v1.2.3