[Python-modules-commits] [python-social-auth] 36/322: Avoid override of custom-usernames fields with plain generated username. Refs #435

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:12:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.10
in repository python-social-auth.

commit 15e366f4531dac74b8fb35718f1dd13a316915c3
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Sat Nov 15 20:22:10 2014 -0200

    Avoid override of custom-usernames fields with plain generated username. Refs #435
---
 social/storage/django_orm.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/social/storage/django_orm.py b/social/storage/django_orm.py
index 02d233a..7aaf982 100644
--- a/social/storage/django_orm.py
+++ b/social/storage/django_orm.py
@@ -54,8 +54,9 @@ class DjangoUserMixin(UserMixin):
 
     @classmethod
     def create_user(cls, *args, **kwargs):
-        if 'username' in kwargs:
-            kwargs[cls.username_field()] = kwargs.pop('username')
+        username_field = cls.username_field()
+        if 'username' in kwargs and username_field not in kwargs:
+            kwargs[username_field] = kwargs.pop('username')
         return cls.user_model().objects.create_user(*args, **kwargs)
 
     @classmethod

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git



More information about the Python-modules-commits mailing list