From: Matías Aguirre Date: Mon, 11 Jul 2011 20:32:22 +0000 (-0300) Subject: Change data loading order to be more useful when signals are called. Refs gh-99 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6be193d0a5a7297bcac0ca67eb408024fca364e2;p=django-social-auth.git Change data loading order to be more useful when signals are called. Refs gh-99 --- diff --git a/social_auth/backends/__init__.py b/social_auth/backends/__init__.py index e41d171..865c2d9 100644 --- a/social_auth/backends/__init__.py +++ b/social_auth/backends/__init__.py @@ -138,8 +138,7 @@ class SocialAuthBackend(ModelBackend): raise ValueError('Account already in use.', social_user) user = social_user.user - # Update user account data. - self.update_user_details(user, response, details, is_new) + # Flag user "new" status setattr(user, 'is_new', is_new) # Update extra_data storage, unless disabled by setting @@ -150,6 +149,9 @@ class SocialAuthBackend(ModelBackend): social_user.save() user.social_user = social_user + + # Update user account data. + self.update_user_details(user, response, details, is_new) return user def username(self, details):