From: Matías Aguirre Date: Mon, 30 May 2011 22:44:58 +0000 (-0300) Subject: Properly split custom user string for get_model usage. Closes gh-80 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3365cd79a3efa3a0cc352dfe4a564ade65a698d7;p=django-social-auth.git Properly split custom user string for get_model usage. Closes gh-80 --- diff --git a/social_auth/models.py b/social_auth/models.py index c1295da..219f901 100644 --- a/social_auth/models.py +++ b/social_auth/models.py @@ -22,7 +22,8 @@ RECOMMENDED_FIELDS = ('username', 'last_login', 'is_active') RECOMMENDED_METHODS = ('is_authenticated',) if getattr(settings, 'SOCIAL_AUTH_USER_MODEL', None): - User = models.get_model(*settings.SOCIAL_AUTH_USER_MODEL.split('.')) + User = models.get_model(*settings.SOCIAL_AUTH_USER_MODEL.rsplit('.', 1)) + missing = list(set(RECOMMENDED_FIELDS) - set(User._meta.get_all_field_names())) + \ [name for name in RECOMMENDED_METHODS