summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-12 15:21:45 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-12 15:21:45 -0400
commit8753a091acea14cd9ca735cb80961c7b3a5a4ef3 (patch)
tree3c8dd75fbd1db110f548275a2d870104c37d27f0
parentdd5916bd3fb4ebc9a1f705efc6677946e3556626 (diff)
downloadaskbot-8753a091acea14cd9ca735cb80961c7b3a5a4ef3.tar.gz
askbot-8753a091acea14cd9ca735cb80961c7b3a5a4ef3.tar.bz2
askbot-8753a091acea14cd9ca735cb80961c7b3a5a4ef3.zip
fixed ldap user accounts where django user name is created by the users
-rw-r--r--askbot/deps/django_authopenid/ldap_auth.py2
-rw-r--r--askbot/deps/django_authopenid/views.py2
-rw-r--r--askbot/utils/forms.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/askbot/deps/django_authopenid/ldap_auth.py b/askbot/deps/django_authopenid/ldap_auth.py
index 5e650714..a633aa3b 100644
--- a/askbot/deps/django_authopenid/ldap_auth.py
+++ b/askbot/deps/django_authopenid/ldap_auth.py
@@ -176,7 +176,7 @@ def ldap_create_user_default(user_info):
"""
# create new user in local db
user = User()
- user.username = user_info['ldap_username']
+ user.username = user_info.get('django_username', user_info['ldap_username'])
user.set_unusable_password()
user.first_name = user_info['first_name']
user.last_name = user_info['last_name']
diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py
index 3132d7ba..73280011 100644
--- a/askbot/deps/django_authopenid/views.py
+++ b/askbot/deps/django_authopenid/views.py
@@ -918,7 +918,7 @@ def register(request, login_provider_name=None, user_identifier=None):
user_info = request.session['ldap_user_info']
#we take this info from the user input where
#they can override the default provided by LDAP
- user_info['ldap_username'] = username
+ user_info['django_username'] = username
user_info['email'] = email
user = ldap_create_user(user_info).user
del request.session['ldap_user_info']
diff --git a/askbot/utils/forms.py b/askbot/utils/forms.py
index 7de555ef..81c10d71 100644
--- a/askbot/utils/forms.py
+++ b/askbot/utils/forms.py
@@ -80,7 +80,7 @@ class UserNameField(StrippedNonEmptyCharField):
error_messages.update(kw['error_messages'])
del kw['error_messages']
- max_length = MAX_USERNAME_LENGTH
+ max_length = MAX_USERNAME_LENGTH()
super(UserNameField,self).__init__(max_length=max_length,
widget=forms.TextInput(attrs=login_form_widget_attrs),
label=label,