X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/2444d6ffd7995be782615589fb1d5aef2c8277ce..04aadd147b0d494c043caf9702684592652a26ab:/forum/forms/qanda.py?ds=inline diff --git a/forum/forms/qanda.py b/forum/forms/qanda.py index 9890640..3e95355 100644 --- a/forum/forms/qanda.py +++ b/forum/forms/qanda.py @@ -5,8 +5,10 @@ from forum.models import * from django.utils.translation import ugettext as _ from django.contrib.humanize.templatetags.humanize import apnumber +from django.utils.encoding import smart_unicode from django.utils.safestring import mark_safe from general import NextUrlField, UserNameField, SetPasswordForm + from forum import settings from forum.modules import call_all_handlers @@ -17,8 +19,8 @@ class TitleField(forms.CharField): def __init__(self, *args, **kwargs): super(TitleField, self).__init__(*args, **kwargs) self.required = True - self.widget = forms.TextInput(attrs={'size' : 70, 'autocomplete' : 'off'}) self.max_length = 255 + self.widget = forms.TextInput(attrs={'size' : 70, 'autocomplete' : 'off', 'maxlength' : self.max_length}) self.label = _('title') self.help_text = _('please enter a descriptive title for your question') self.initial = '' @@ -213,7 +215,7 @@ class RevisionForm(forms.Form): date_format = '%c' self.fields['revision'].choices = [ - (r[0], u'%s - %s (%s) %s' % (r[0], r[1], r[2].strftime(date_format), r[3])) + (r[0], u'%s - %s (%s) %s' % (r[0], smart_unicode(r[1]), r[2].strftime(date_format), r[3])) for r in revisions] self.fields['revision'].initial = post.active_revision.revision @@ -296,8 +298,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