On Fri, 2007-03-16 at 00:06 +0100, Sandro Dentella wrote:
> Hi all,
> 
>   I'm using _thread_locals as in:
>   http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
>   to keep track of the user that triggered operation in contexts where
>   request.user is not available (eg: managers).
> 
>   I realize now that signal do not preserve it (I guess that are run in a
>   different thread, correct?)

What do you mean by "preserve it"? A signal dispatch is just a series of
function calls. They happen in the same thread as whatever does the
dispatch.

>   Is there a way to tell the receiver of a signal who was the user that
>   triggered the operation for which the signal was emitted?

For most signals it doesn't make sense to talk about "the user", since
they are not view-related. Carrying around the current user in the
thread locals is a way to work around that (and a good way to do so),
but it's not something we want to integrate at lower levels.

>   In particular, I send e-mail every time a ticket is opened, but would like
>   to set the e-mail of the sender for a replay.

In this particular case, isn't the email of the sender is stored in the
ticket somewhere? Why can't you pull it out from there?

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to