summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-08-19 18:14:04 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-08-19 18:14:04 -0400
commit3917b73d5bd4089f97805be73048742e3a6362da (patch)
tree98f02cf2aa94b96ed5d5a6d80dc67c7bc95097aa
parent0f581ab94fcaf3e1f08cd774a8c8a570939d375f (diff)
downloadaskbot-3917b73d5bd4089f97805be73048742e3a6362da.tar.gz
askbot-3917b73d5bd4089f97805be73048742e3a6362da.tar.bz2
askbot-3917b73d5bd4089f97805be73048742e3a6362da.zip
allow unicode user name, make date of birth optional and changed wording in faq
-rw-r--r--askbot/forms.py50
-rw-r--r--askbot/skins/default/templates/faq.html2
-rw-r--r--askbot/utils/forms.py2
-rw-r--r--askbot/views/users.py6
4 files changed, 45 insertions, 15 deletions
diff --git a/askbot/forms.py b/askbot/forms.py
index 2fd1afd5..76f85741 100644
--- a/askbot/forms.py
+++ b/askbot/forms.py
@@ -444,14 +444,49 @@ class EditAnswerForm(forms.Form):
self.fields['text'].initial = revision.text
class EditUserForm(forms.Form):
- email = forms.EmailField(label=u'Email', help_text=_('this email does not have to be linked to gravatar'), required=True, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
+ email = forms.EmailField(
+ label=u'Email',
+ help_text=_('this email does not have to be linked to gravatar'),
+ required=True,
+ max_length=255,
+ widget=forms.TextInput(attrs={'size' : 35})
+ )
+
if askbot_settings.EDITABLE_SCREEN_NAME:
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}))
- birthday = forms.DateField(label=_('Date of birth'), help_text=_('will not be shown, used to calculate age, format: YYYY-MM-DD'), required=False, widget=forms.TextInput(attrs={'size' : 35}))
- about = forms.CharField(label=_('Profile'), required=False, widget=forms.Textarea(attrs={'cols' : 60}))
+ 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})
+ )
+
+ birthday = forms.DateField(
+ label=_('Date of birth'),
+ help_text=_('will not be shown, used to calculate age, format: YYYY-MM-DD'),
+ required=False,
+ widget=forms.TextInput(attrs={'size' : 35})
+ )
+
+ about = forms.CharField(
+ label=_('Profile'),
+ required=False,
+ widget=forms.Textarea(attrs={'cols' : 60})
+ )
def __init__(self, user, *args, **kwargs):
super(EditUserForm, self).__init__(*args, **kwargs)
@@ -466,8 +501,7 @@ class EditUserForm(forms.Form):
if user.date_of_birth is not None:
self.fields['birthday'].initial = user.date_of_birth
- else:
- self.fields['birthday'].initial = '1990-01-01'
+
self.fields['about'].initial = user.about
self.user = user
diff --git a/askbot/skins/default/templates/faq.html b/askbot/skins/default/templates/faq.html
index 83a24d68..f3a26d0f 100644
--- a/askbot/skins/default/templates/faq.html
+++ b/askbot/skins/default/templates/faq.html
@@ -71,7 +71,7 @@
</tr>
<tr>
<td class="faq-rep-item"><strong>{{settings.MIN_REP_TO_RETAG_OTHERS_QUESTIONS}}</strong></td>
- <td>{% trans "retag questions" %}</td>
+ <td>{% trans "retag other's questions" %}</td>
</tr>
{% if settings.WIKI_ON %}
<tr>
diff --git a/askbot/utils/forms.py b/askbot/utils/forms.py
index 62aa0170..575416bc 100644
--- a/askbot/utils/forms.py
+++ b/askbot/utils/forms.py
@@ -85,7 +85,7 @@ class UserNameField(StrippedNonEmptyCharField):
except forms.ValidationError:
raise forms.ValidationError(self.error_messages['required'])
- username_regex = re.compile(const.USERNAME_REGEX_STRING)
+ username_regex = re.compile(const.USERNAME_REGEX_STRING, re.UNICODE)
if self.required and not username_regex.search(username):
raise forms.ValidationError(self.error_messages['invalid'])
if username in self.RESERVED_NAMES:
diff --git a/askbot/views/users.py b/askbot/views/users.py
index ea1f03a5..9f74fbf4 100644
--- a/askbot/views/users.py
+++ b/askbot/views/users.py
@@ -253,11 +253,7 @@ def edit_user(request, id):
user.real_name = sanitize_html(form.cleaned_data['realname'])
user.website = sanitize_html(form.cleaned_data['website'])
user.location = sanitize_html(form.cleaned_data['city'])
- user.date_of_birth = sanitize_html(form.cleaned_data['birthday'])
-
- if len(user.date_of_birth) == 0:
- user.date_of_birth = '1900-01-01'
-
+ user.date_of_birth = form.cleaned_data.get('birthday', None)
user.about = sanitize_html(form.cleaned_data['about'])
user.save()