From 5bb659026bffba8bf5edf113a4049beece4d0b12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Aguirre?= Date: Fri, 16 Sep 2011 17:56:56 -0300 Subject: [PATCH] Send signal for cases where tracking failed registering is needed --- social_auth/backends/__init__.py | 7 ++++++- social_auth/signals.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) 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']) -- 2.39.5