summaryrefslogtreecommitdiffstats
path: root/pyload/api/AccountApi.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/api/AccountApi.py')
-rw-r--r--pyload/api/AccountApi.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pyload/api/AccountApi.py b/pyload/api/AccountApi.py
index 144074d3c..d4b39c12b 100644
--- a/pyload/api/AccountApi.py
+++ b/pyload/api/AccountApi.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+from pyload.utils import to_bool
from pyload.Api import Api, RequirePerm, Permission, Conflict
from ApiComponent import ApiComponent
@@ -49,13 +50,21 @@ class AccountApi(ApiComponent):
:return: newly created or updated account info
"""
+ # TODO: None pointer
return self.core.accountManager.updateAccount(plugin, loginname, password, self.user).toInfoData()
@RequirePerm(Permission.Accounts)
def updateAccountInfo(self, account):
""" Update account settings from :class:`AccountInfo` """
- #TODO
+ inst = self.core.accountManager.getAccount(account.plugin, account.loginname, self.user)
+ if not account:
+ return
+
+ inst.activated = to_bool(account.activated)
+ inst.shared = to_bool(account.shared)
+ inst.updateConfig(account.config)
+
@RequirePerm(Permission.Accounts)
def removeAccount(self, account):