diff options
Diffstat (limited to 'pyload/webui/app')
-rw-r--r-- | pyload/webui/app/api.py | 2 | ||||
-rw-r--r-- | pyload/webui/app/json.py | 10 | ||||
-rw-r--r-- | pyload/webui/app/utils.py | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/pyload/webui/app/api.py b/pyload/webui/app/api.py index 16e8c2447..0e36b7c1f 100644 --- a/pyload/webui/app/api.py +++ b/pyload/webui/app/api.py @@ -17,6 +17,7 @@ from pyload.api import BaseObject # json encoder that accepts TBase objects class TBaseEncoder(json.JSONEncoder): + def default(self, o): if isinstance(o, BaseObject): return toDict(o) @@ -24,7 +25,6 @@ class TBaseEncoder(json.JSONEncoder): # accepting positional arguments, as well as kwargs via post and get - @route('/api/<func><args:re:[a-zA-Z0-9\-_/\"\'\[\]%{},]*>') @route('/api/<func><args:re:[a-zA-Z0-9\-_/\"\'\[\]%{},]*>', method='POST') def call_api(func, args=""): diff --git a/pyload/webui/app/json.py b/pyload/webui/app/json.py index 51159ddf3..12dce2484 100644 --- a/pyload/webui/app/json.py +++ b/pyload/webui/app/json.py @@ -241,7 +241,8 @@ def load_config(category, section): conf = PYLOAD.getPluginConfigDict() for key, option in conf[section].iteritems(): - if key in ("desc", "outline"): continue + if key in ("desc", "outline"): + continue if ";" in option['type']: option['list'] = option['type'].split(";") @@ -282,12 +283,14 @@ def update_accounts(): for name, value in request.POST.iteritems(): value = value.strip() - if not value: continue + if not value: + continue tmp, user = name.split(";") plugin, action = tmp.split("|") - if (plugin, user) in deleted: continue + if (plugin, user) in deleted: + continue if action == "password": PYLOAD.updateAccount(plugin, user, value) @@ -299,6 +302,7 @@ def update_accounts(): deleted.append((plugin,user)) PYLOAD.removeAccount(plugin, user) + @route('/json/change_password', method='POST') def change_password(): diff --git a/pyload/webui/app/utils.py b/pyload/webui/app/utils.py index f9931f531..69067d8fe 100644 --- a/pyload/webui/app/utils.py +++ b/pyload/webui/app/utils.py @@ -9,6 +9,7 @@ from pyload.webui import env, THEME from pyload.api import has_permission, PERMS, ROLE + def render_to_response(file, args={}, proc=[]): for p in proc: args.update(p()) @@ -56,7 +57,8 @@ def set_permission(perms): """ permission = 0 for name in dir(PERMS): - if name.startswith("_"): continue + if name.startswith("_"): + continue if name in perms and perms[name]: permission |= getattr(PERMS, name) |