Skip to content

Commit

Permalink
Updated doc with user-new signal details
Browse files Browse the repository at this point in the history
  • Loading branch information
omab committed Apr 14, 2011
1 parent c66baf9 commit 0c56404
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.rst
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions doc/signals.rst
Expand Up @@ -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

0 comments on commit 0c56404

Please sign in to comment.