]> git.parisson.com Git - django-social-auth.git/commitdiff
Updated doc with user-new signal details
authorMatías Aguirre <matiasaguirre@gmail.com>
Thu, 14 Apr 2011 13:26:54 +0000 (10:26 -0300)
committerMatías Aguirre <matiasaguirre@gmail.com>
Thu, 14 Apr 2011 13:26:54 +0000 (10:26 -0300)
README.rst
doc/signals.rst

index 45dc3663f354c56eefcb40ea7ec3791ed11df95d..25c8cb82ec87f8cc077d70f592b5853678fbf385 100644 (file)
@@ -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
index bfdb2e2ab537250c6a6330b1ca8ac2a9a18abb70..9a9fd2019f03ed4e1d5a9f07223c5a566d394866 100644 (file)
@@ -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