Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #131 (closed defect: fixed)

Opened 14 years ago

Last modified 12 years ago

Move turbogears.identity.{current,provider} to cherrypy.request

Reported by: Paul Clifford Owned by: Jeff Watkins
Priority: normal Milestone: 0.9
Component: Identity Version:
Severity: normal Keywords: 2.3
Cc:

Description

turbogears/identity/init.py uses threading.local(), which isn't available in the standard Python 2.3 library. I think a trivial fix would be to change the line "threadData = threading.local()" to "threadData = cherrypy.threadData", but Kevin suggested that identity should become part of cherrypy.request instead.

This patch moves turbogears.identity.current to cherrypy.request.identity, and turbogears.identity.provider to cherrypy.request.id_provider. I've tested the code with the "Identity Framework Sample" at  http://newburyportion.com/nerd/2005/11/identity-sample and, after changing the logout method to use cherrypy.request.identity, it still seems to work as advertised.

Attachments

turbogears-identity-py2.3.diff Download (6.7 KB) - added by Paul Clifford 14 years ago.
Move turbogears.identity.{current,provider} under cherrypy.request

Change History

Changed 14 years ago by Paul Clifford

Move turbogears.identity.{current,provider} under cherrypy.request

comment:1 Changed 14 years ago by seancazzell@…

I agree with kevin on storing the logged in user in cherrypy.request. Also, it looks like we could get rid of the global identity.provider stuff - I see no reason to keep the provider object around.

comment:2 Changed 14 years ago by jeff@…

  • Owner changed from anonymous to Jeff Watkins

I'll take a look at this patch and apply it (or something like it) this weekend.

comment:3 Changed 13 years ago by jeff@…

  • Status changed from new to closed
  • Resolution set to fixed

Change 255 addressed this.

Note: See TracTickets for help on using tickets.