Commits

Sylvain Hellegouarch committed 8c570e9

Backport fix to get rid of thread_data. This may need to be documented for applications relying on the value being set. Instead they should now use request.user

  • Participants
  • Parent commits 569e842
  • Branches cherrypy-2.x

Comments (0)

Files changed (1)

cherrypy/filters/sessionauthenticatefilter.py

     
     def before_main(self):
         cherrypy.request.user = None
-        cherrypy.thread_data.user = None
 
         conf = cherrypy.config.get
         if ((not conf('session_authenticate_filter.on', False))
             login = cherrypy.session.get(session_key)
             cherrypy.session[session_key] = None
             cherrypy.request.user = None
-            cherrypy.thread_data.user = None
             if login and on_logout:
                 on_logout(login)
             from_page = cherrypy.request.params.get('from_page', '..')
             return
         
         # Everything is OK: user is logged in
-        if load_user_by_username and not cherrypy.thread_data.user:
+        if load_user_by_username and not cherrypy.request.user:
             username = temp_user or cherrypy.session[session_key]
             cherrypy.request.user = load_user_by_username(username)
-            cherrypy.thread_data.user = cherrypy.request.user