diff options
Diffstat (limited to 'pyload/webui/app/utils.py')
-rw-r--r-- | pyload/webui/app/utils.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pyload/webui/app/utils.py b/pyload/webui/app/utils.py index 69067d8fe..2753b7feb 100644 --- a/pyload/webui/app/utils.py +++ b/pyload/webui/app/utils.py @@ -80,8 +80,8 @@ def set_session(request, info): def parse_userdata(session): - return {"name": session.get("name", "Anonymous"), - "is_admin": True if session.get("role", 1) == 0 else False, + return {"name" : session.get("name", "Anonymous"), + "is_admin" : session.get("role", 1) == 0, "is_authenticated": session.get("authenticated", False)} @@ -115,10 +115,7 @@ def login_required(perm=None): def toDict(obj): - ret = {} - for att in obj.__slots__: - ret[att] = getattr(obj, att) - return ret + return {att: getattr(obj, att) for att in obj.__slots__} class CherryPyWSGI(ServerAdapter): |