]> git.parisson.com Git - django-social-auth.git/commitdiff
Some more logging.
authorMathijs de Bruin <mathijs@mathijsfietst.nl>
Mon, 19 Sep 2011 13:00:53 +0000 (15:00 +0200)
committerMathijs de Bruin <mathijs@mathijsfietst.nl>
Mon, 19 Sep 2011 13:00:53 +0000 (15:00 +0200)
social_auth/backends/__init__.py

index 5832e7e957d4023a5a340912e2ccfd49a9d32f1f..b0470d1514740291ed56daf1b287c50e40655036 100644 (file)
@@ -38,6 +38,7 @@ from social_auth.models import UserSocialAuth
 from social_auth.store import DjangoOpenIDStore
 from social_auth.signals import pre_update, socialauth_registered, \
                                 socialauth_not_registered
+from social_auth.utils import sanitize_log_data
 
 
 # OpenID configuration
@@ -136,6 +137,8 @@ class SocialAuthBackend(ModelBackend):
                         user = None
                 if not user:
                     username = self.username(details)
+                    logger.debug('Creating new user with username %s and email %s',
+                                 username, sanitize_log_data(email))
                     user = User.objects.create_user(username=username,
                                                     email=email)
                     is_new = True
@@ -223,6 +226,8 @@ class SocialAuthBackend(ModelBackend):
 
         # check if values update should be left to signals handlers only
         if not CHANGE_SIGNAL_ONLY:
+            logger.debug('Updating user details for user %s', username,
+                         extra=dict(data=details))
             for name, value in details.iteritems():
                 # do not update username, it was already generated by
                 # self.username(...) and loaded in given instance