Celery tasks are called by storing the value they are passed to (via the `send_welcome_email.delay` call in the view) so they can pass the data to the Celery workers. If you pass in a User object like this, you'll find that the state of the user is passed along to the worker. The problem with that is that it's not guarenteed that the Python object representing the user is still matching what is in the database. In other words, due to Celery's asynchronous nature, you must only pass in easily identifiable data for the entry in the database and *refetch the `user` object from the database*.

The signature of the task should look something like that:

    @task
    def send_welcome_email(user_pk):
        user = User.objects.get(pk=user_pk)
        # ..

and the call in the view:

    if switch_is_active('welcome_email'):
        send_welcome_email.delay(user.pk)