0

I had the below code which was working perfectly in django 1.4, since I upgraded everything in the code remains functional accept for the signal is not being fired at all.

Previously, when I was on 1.4, I was using user Profile to maintain user information, but when upgraded I used custom user model which contains all details at one table. I don't think its relevant, because the when I test social auth its all working fine, accept for this part.

def twitter_extra_values(sender, user, response, details, **kwargs):
    """
    accounts - twitter_extra_values - signal
    """
    try:
        TwitterExtra.objects.get_or_create(
            user        =   user,
            screen_name =   response.get('screen_name')
        )
    except IntegrityError:
        TwitterExtra.objects.get(
            user        =   user,
            screen_name =   response.get('screen_name')
        ).delete()
        # recursively attempt to recreate the record
        twitter_extra_values(sender, user, response, details, **kwargs)

    return True


pre_update.connect(twitter_extra_values, sender=TwitterBackend, dispatch_uid="accounts.twitter_extra_values")
Mo J. Mughrabi
  • 6,747
  • 16
  • 85
  • 143
  • This is just a guess but I was experiencing a similar problem with the sender parameter. As soon as I took the parameter out, then it started to work again. If you still need to control the sender of the signal, you should try `issubclass(sender, Document)`. Also, you might want to be sure that there is just `one dispatch_uid` and `import uuid` and send `dispatch_uid=str(uuid.uuid1())` as the last parameter. – toto_tico Apr 13 '13 at 22:39

1 Answers1

0

You probably upgraded django-social-auth as well.

Signals are deprecated: http://django-social-auth.readthedocs.org/en/latest/deprecated.html and were removed recently.

Here is example of setting facebook avatar using pipeline step: http://tryolabs.com/Blog/2012/02/13/get-user-data-using-django-social-auth/

jenda
  • 1