]> git.parisson.com Git - django-social-auth.git/commitdiff
Using dict.get to avoid KeyError
authorAndres Villavicencio <andres@unholster.com>
Mon, 9 Jan 2012 05:22:02 +0000 (05:22 +0000)
committerAndres Villavicencio <andres@unholster.com>
Mon, 9 Jan 2012 05:22:02 +0000 (05:22 +0000)
social_auth/backends/__init__.py

index d87aa06c6cc2dee5dd547d48d665b8e6fdcd7cef..df8d7eecea1ca6b800d1bf4a8e622873005a2342 100644 (file)
@@ -114,7 +114,7 @@ class SocialAuthBackend(ModelBackend):
             # account
             user = social_user.user
             user.social_user = social_user
-            user.is_new = out['is_new']
+            user.is_new = out.get('is_new')
             return user
 
     def pipeline(self, pipeline, request, *args, **kwargs):