mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Catch exception and return default session
This commit is contained in:
parent
11659df89d
commit
fc21f043ae
1 changed files with 9 additions and 11 deletions
|
@ -25,17 +25,15 @@ def get_session_info():
|
|||
"""
|
||||
from plexpy.webauth import SESSION_KEY
|
||||
|
||||
# Hacky solution to exclude not cherrypy threads from sessions
|
||||
if 'CP Server' in threading.current_thread().name and cherrypy.config.get('tools.sessions.on'):
|
||||
_session = cherrypy.session.get(SESSION_KEY)
|
||||
if _session:
|
||||
return _session
|
||||
|
||||
return {'user_id': None,
|
||||
_session = {'user_id': None,
|
||||
'user': None,
|
||||
'user_group': 'admin',
|
||||
'user_libraries': None,
|
||||
'expiry': None}
|
||||
try:
|
||||
return cherrypy.session.get(SESSION_KEY, _session)
|
||||
except AttributeError as e:
|
||||
return _session
|
||||
|
||||
def get_session_user():
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue