summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-14 20:59:01 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-14 20:59:01 +0200
commit853d29a0f12cdcb6c406b829a57439c7ea9b570d (patch)
tree047d94a11037617521c7a50130a6ead538c5daf7 /module/web
parentfixed config on webif + show description (diff)
downloadpyload-853d29a0f12cdcb6c406b829a57439c7ea9b570d.tar.xz
has_key refractored, package name generator by Geek
Diffstat (limited to 'module/web')
-rw-r--r--module/web/pyload_app.py4
-rw-r--r--module/web/utils.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py
index 0131e888f..22003da43 100644
--- a/module/web/pyload_app.py
+++ b/module/web/pyload_app.py
@@ -307,13 +307,13 @@ def config():
t = time.localtime(data.validuntil)
data.validuntil = time.strftime("%d.%m.%Y", t)
- if data.options.has_key("time"):
+ if "time" in data.options:
try:
data.options["time"] = data.options["time"][0]
except:
data.options["time"] = "0:00-0:00"
- if data.options.has_key("limitDL"):
+ if "limitDL" in data.options:
data.options["limitdl"] = data.options["limitDL"][0]
else:
data.options["limitdl"] = "0"
diff --git a/module/web/utils.py b/module/web/utils.py
index 1455c3c01..b99736216 100644
--- a/module/web/utils.py
+++ b/module/web/utils.py
@@ -92,7 +92,7 @@ def login_required(perm=None):
if s.get("name", None) and s.get("authenticated", False):
if perm:
perms = parse_permissions(s)
- if not perms.has_key(perm) or not perms[perm]:
+ if perm not in perms or not perms[perm]:
if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
return HTTPError(403, "Forbidden")
else: