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

Comments (0)

Files changed (1)


     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:
             from_page = cherrypy.request.params.get('from_page', '..')
         # 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
Tip: Use camelCasing e.g. ProjME to search for