summaryrefslogtreecommitdiffstats
path: root/forum/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'forum/forms.py')
-rw-r--r--forum/forms.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/forum/forms.py b/forum/forms.py
index 5b181d48..511a0a0d 100644
--- a/forum/forms.py
+++ b/forum/forms.py
@@ -4,7 +4,7 @@ from django import forms
from models import *
from const import *
from django.utils.translation import ugettext as _
-from django_authopenid.forms import NextUrlField
+from django_authopenid.forms import NextUrlField, UserNameField
import settings
class TitleField(forms.CharField):
@@ -195,6 +195,7 @@ class EditAnswerForm(forms.Form):
class EditUserForm(forms.Form):
email = forms.EmailField(label=u'Email', help_text=_('this email does not have to be linked to gravatar'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
+ username = UserNameField(label=_('Screen name'))
realname = forms.CharField(label=_('Real name'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
website = forms.URLField(label=_('Website'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
city = forms.CharField(label=_('Location'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
@@ -203,6 +204,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['email'].initial = user.email
self.fields['realname'].initial = user.real_name
self.fields['website'].initial = user.website