]> git.parisson.com Git - django-social-auth.git/commitdiff
Avoid override of id/pk attributes with service provided data. Closes #217
authorMatías Aguirre <matiasaguirre@gmail.com>
Mon, 9 Jan 2012 05:19:46 +0000 (03:19 -0200)
committerMatías Aguirre <matiasaguirre@gmail.com>
Mon, 9 Jan 2012 05:19:46 +0000 (03:19 -0200)
social_auth/backends/pipeline/user.py

index b1acc48824565e4aae36ae68e837631a452e35d8..eaca1ae261658655235e3c7f440e0ab04ba779b4 100644 (file)
@@ -92,7 +92,7 @@ def update_user_details(backend, details, response, user, is_new=False, *args,
     if not getattr(settings, 'SOCIAL_AUTH_CHANGE_SIGNAL_ONLY', False):
         for name, value in details.iteritems():
             # do not update username, it was already generated
-            if name == USERNAME:
+            if name in (USERNAME, 'id', 'pk'):
                 continue
             if value and value != getattr(user, name, None):
                 setattr(user, name, value)