From: Matías Aguirre Date: Thu, 14 Apr 2011 13:26:54 +0000 (-0300) Subject: Updated doc with user-new signal details X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0c56404ea1eebbf36086f38caaf74c79d4ec5213;p=django-social-auth.git Updated doc with user-new signal details --- diff --git a/README.rst b/README.rst index 45dc366..25c8cb8 100644 --- a/README.rst +++ b/README.rst @@ -277,6 +277,16 @@ Take into account that when defining a custom User model and declaring signal handler in models.py, the imports and handler definition *must* be made after the custom User model is defined or circular imports issues will be raised. +Also a new-user signal is sent when new accounts are created:: + + from social_auth.signals import socialauth_registered + + def new_users_handler(sender, user, response, details, **kwargs): + user.is_new = True + return False + + socialauth_registered.connect(new_users_handler, sender=None) + ------ OpenId diff --git a/doc/signals.rst b/doc/signals.rst index bfdb2e2..9a9fd20 100644 --- a/doc/signals.rst +++ b/doc/signals.rst @@ -23,5 +23,15 @@ Take into account that when defining a custom User model and declaring signal handler in models.py, the imports and handler definition *must* be made after the custom User model is defined or circular imports issues will be raised. +Also a new-user signal is sent when new accounts are created:: + + from social_auth.signals import socialauth_registered + + def new_users_handler(sender, user, response, details, **kwargs): + user.is_new = True + return False + + socialauth_registered.connect(new_users_handler, sender=None) + .. _User Profiles: http://www.djangobook.com/en/1.0/chapter12/#cn222