TireSwingSoftware / openassign-server

OpenAssign server intended for use by a separate client via RPC
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Assignment status_change_log cites incorrect creator #106

Closed mhrivnak closed 12 years ago

mhrivnak commented 12 years ago

The log always cites the assigned user as the creator of the assignment, which is not always true. Sometimes an admin will create the assignments.

The current user's AuthToken (and thus their User object) can be obtained from thread-local storage.

https://github.com/TireSwingSoftware/openassign-server/blob/ddad31093c3820192ac5ce3f6ce6491acdb4b5e1/pr_services/pr_models.py#L1199

jc0n commented 12 years ago

I dont see the auth token being stored in thread local storage anywhere. I see in middleware.py the request is being stored. I checked all uses of middleware.get_current_request and did not find anything. Is it possible this functionality (storing auth token) doesn't exist and if so, should I add that as part of the commit?

mhrivnak commented 12 years ago

It looks like I just imagined that the AuthToken object was in thread local storage. I think it's a good idea to have it there, so go for it. The first place you might want to consider for placing it there is in pr_services.rpc.service.ShimInvoke._run(), which is where the AuthToken object is first retrieved for every request.