From: Matías Aguirre Date: Mon, 9 Jan 2012 05:19:46 +0000 (-0200) Subject: Avoid override of id/pk attributes with service provided data. Closes #217 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d7c9c6e235efab31a141bccd85aee9f1db606c96;p=django-social-auth.git Avoid override of id/pk attributes with service provided data. Closes #217 --- diff --git a/social_auth/backends/pipeline/user.py b/social_auth/backends/pipeline/user.py index b1acc48..eaca1ae 100644 --- a/social_auth/backends/pipeline/user.py +++ b/social_auth/backends/pipeline/user.py @@ -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)