]> git.parisson.com Git - django-social-auth.git/commitdiff
Moved definition of USERNAME_MAX_LENGTH to models modules
authorSteven Cummings <estebistec@gmail.com>
Mon, 25 Jun 2012 03:56:12 +0000 (22:56 -0500)
committerSteven Cummings <estebistec@gmail.com>
Mon, 25 Jun 2012 03:56:12 +0000 (22:56 -0500)
social_auth/backends/pipeline/__init__.py
social_auth/backends/pipeline/user.py
social_auth/django_models.py
social_auth/mongoengine_models.py

index 2866a9984bbbaedfd1304b58e2c62eba2e8941e3..7daabc9eca8f975be8d6f9062b2854d245b30a8f 100644 (file)
@@ -5,16 +5,11 @@ to next pipeline item. Pipelines must take **kwargs parameters to avoid
 failure. At some point a pipeline entry must create a UserSocialAuth instance
 and load it to the output if the user logged in correctly.
 """
-import warnings
-
-from django.conf import settings
 
-from social_auth.models import User
-from social_auth.models import USERNAME, get_username_max_length
-from social_auth.backends import get_backend, PIPELINE
 
+import warnings
 
-USERNAME_MAX_LENGTH = get_username_max_length()
+from django.conf import settings
 
 
 def warn_setting(name, func_name):
index ea06079b74ea932d5a2f88ef21a4a709dcafc5d2..16eb1a334ee6943ae6bd73a0111564ebc9b45865 100644 (file)
@@ -3,8 +3,8 @@ from uuid import uuid4
 from social_auth.utils import setting
 from social_auth.models import create_user as create_user_in_db
 from social_auth.models import simple_user_exists
-from social_auth.backends.pipeline import USERNAME, USERNAME_MAX_LENGTH, \
-                                          warn_setting
+from social_auth.models import USERNAME, USERNAME_MAX_LENGTH
+from social_auth.backends.pipeline import warn_setting
 from social_auth.signals import socialauth_not_registered, \
                                 socialauth_registered, \
                                 pre_update
index 34f04f93943823dc12f27407cca26f9d41cb8997..ed37b0d73165a2e2d3c704cf4a4fb8e285862054 100644 (file)
@@ -27,12 +27,7 @@ else:
 
 # TODO make this a complementary config setting to SOCIAL_AUTH_USER_MODEL
 USERNAME = 'username'
-
-
-def get_username_max_length():
-    """Get the max length constraint from the User model username field.
-    """
-    return User._meta.get_field(USERNAME).max_length
+USERNAME_MAX_LENGTH = User._meta.get_field(USERNAME).max_length
 
 
 def simple_user_exists(*args, **kwargs):
index 1f12b868c81ad07e9d550e2381e2f2d290959634..6a2a27d3f2fe1e6108d6a4cf430248a0d6dce9c8 100644 (file)
@@ -35,12 +35,7 @@ else:
 
 # TODO make this a complementary config setting to SOCIAL_AUTH_USER_MODEL
 USERNAME = 'username'
-
-
-def get_username_max_length():
-    """Get the max length constraint from the User model username field.
-    """
-    return getattr(User, USERNAME).max_length
+USERNAME_MAX_LENGTH = getattr(User, USERNAME).max_length
 
 
 def simple_user_exists(*args, **kwargs):