diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/AccountManager.py | 18 | ||||
-rw-r--r-- | module/web/pyload/views.py | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py index a76a9915a..4151f529c 100644 --- a/module/AccountManager.py +++ b/module/AccountManager.py @@ -36,7 +36,6 @@ class AccountManager(): self.accounts = {} # key = ( plugin ) self.plugins = {} - self.accountInfoCache = {} self.initAccountPlugins() @@ -155,21 +154,17 @@ class AccountManager(): p = self.getAccountPlugin(plugin) p.removeAccount(user) - if self.accounts.has_key(p): - if self.accounts[p].has_key(user): - del self.accounts[p][user] - self.saveAccounts() p.getAllAccounts(force=True) self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos) - - def getCachedAccountInfos(self, refresh=True): + + + def getAccountInfos(self, force=True, refresh=False): + data = {} + if refresh: self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos) - return self.accountInfoCache - - def getAccountInfos(self, force=True): - data = {} + force = False for p in self.accounts.keys(): if self.accounts[p]: @@ -177,7 +172,6 @@ class AccountManager(): data[p.__name__] = p.getAllAccounts(force) else: data[p] = [] - self.accountInfoCache = data e = AccountUpdateEvent() self.core.pullManager.addEvent(e) return data diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index ec690db1a..240465285 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -342,7 +342,7 @@ def config(request): else: messages.append(_("All options were set correctly.")) - accs = deepcopy(settings.PYLOAD.get_accounts()) + accs = deepcopy(settings.PYLOAD.get_accounts(False, False)) for accounts in accs.itervalues(): for data in accounts: if data["trafficleft"] == -1: |