summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Ross <rick@dzone.com>2010-01-16 18:05:36 -0500
committerRick Ross <rick@dzone.com>2010-01-16 18:05:36 -0500
commit180b3210d76a72451b93a0741ffb35c90d861c9f (patch)
treeb6e02d58b618a631de1eb586053e62feccc3e997
parent456e24961954c3c34f5ad2d0ce035440cb6a671e (diff)
downloadaskbot-180b3210d76a72451b93a0741ffb35c90d861c9f.tar.gz
askbot-180b3210d76a72451b93a0741ffb35c90d861c9f.tar.bz2
askbot-180b3210d76a72451b93a0741ffb35c90d861c9f.zip
fix to make update profile work
-rw-r--r--django_authopenid/forms.py3
-rw-r--r--forum/forms.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/django_authopenid/forms.py b/django_authopenid/forms.py
index d4482751..6781401e 100644
--- a/django_authopenid/forms.py
+++ b/django_authopenid/forms.py
@@ -88,6 +88,9 @@ class UserNameField(forms.CharField):
username = super(UserNameField,self).clean(username.strip())
if self.skip_clean == True:
return username
+ if hasattr(self, 'user_instance'):
+ if username == self.user_instance.username:
+ return username
if not username_re.search(username):
raise forms.ValidationError(self.error_messages['invalid'])
if username in self.RESERVED_NAMES:
diff --git a/forum/forms.py b/forum/forms.py
index ad2c5bac..376f5ddf 100644
--- a/forum/forms.py
+++ b/forum/forms.py
@@ -205,6 +205,7 @@ class EditUserForm(forms.Form):
def __init__(self, user, *args, **kwargs):
super(EditUserForm, self).__init__(*args, **kwargs)
self.fields['username'].initial = user.username
+ self.fields['username'].user_instance = user
self.fields['email'].initial = user.email
self.fields['realname'].initial = user.real_name
self.fields['website'].initial = user.website