From: Matías Aguirre Date: Fri, 16 Sep 2011 20:56:56 +0000 (-0300) Subject: Send signal for cases where tracking failed registering is needed X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=5bb659026bffba8bf5edf113a4049beece4d0b12;p=django-social-auth.git Send signal for cases where tracking failed registering is needed --- diff --git a/social_auth/backends/__init__.py b/social_auth/backends/__init__.py index c0be5e6..c241a60 100644 --- a/social_auth/backends/__init__.py +++ b/social_auth/backends/__init__.py @@ -33,7 +33,8 @@ from django.db.utils import IntegrityError from social_auth.models import UserSocialAuth from social_auth.store import DjangoOpenIDStore -from social_auth.signals import pre_update, socialauth_registered +from social_auth.signals import pre_update, socialauth_registered, \ + socialauth_not_registered # OpenID configuration @@ -111,6 +112,10 @@ class SocialAuthBackend(ModelBackend): except UserSocialAuth.DoesNotExist: if user is None: # new user if not CREATE_USERS or not kwargs.get('create_user', True): + # Send signal for cases where tracking failed registering + # is useful. + socialauth_not_registered.send(uid=uid, response=response, + details=details) return None email = details.get('email') diff --git a/social_auth/signals.py b/social_auth/signals.py index 5b2af9e..7e5db38 100644 --- a/social_auth/signals.py +++ b/social_auth/signals.py @@ -1,7 +1,7 @@ """Signals""" from django.dispatch import Signal -# Pre save signal +# Pre update signal # This signal is sent when user instance is about to be updated with # new values from services provided. This way custom actions can be # attached and values updated if needed before the saving time. @@ -18,3 +18,5 @@ from django.dispatch import Signal pre_update = Signal(providing_args=['user', 'response', 'details']) socialauth_registered = Signal(providing_args=['user', 'response', 'details']) + +socialauth_not_registered = Signal(providing_args=['uid', 'response', 'details'])