From: qw3rty Date: Wed, 28 Apr 2010 15:19:00 +0000 (+0000) Subject: 1) rick wanted me to change the default size of comments to 600 X-Git-Tag: live~996 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/cd19cb00154021685ea43d164a4dc8599b2e0a0e 1) rick wanted me to change the default size of comments to 600 2) Fixed OSQA-146 - Note: if the user doesn't enter a birthday then when they go back to edit there page the page will display there birthday as "1900-01-01." This is fairly sloppy and will take a little bit of refactoring to fix. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@83 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/settings/basic.py b/forum/settings/basic.py index b712365..0148452 100644 --- a/forum/settings/basic.py +++ b/forum/settings/basic.py @@ -60,9 +60,8 @@ help_text = _(""" The copyright notice visible at the footer of your page. """))) -COMMENT_MAX_LENGTH = Setting('COMMENT_MAX_LENGTH', 300, BASIC_SET, dict( +COMMENT_MAX_LENGTH = Setting('COMMENT_MAX_LENGTH', 600, BASIC_SET, dict( label = _("Maximum length of comment"), help_text = _(""" The maximum length a user can enter for a comment. -"""))) - +"""))) \ No newline at end of file diff --git a/forum/skins/default/templates/users/info.html b/forum/skins/default/templates/users/info.html index 690fc7e..fb6fcde 100644 --- a/forum/skins/default/templates/users/info.html +++ b/forum/skins/default/templates/users/info.html @@ -82,8 +82,10 @@ {% if view_user.date_of_birth%} - {% trans "age" %} - {% get_age view_user.date_of_birth %} {% trans "age unit" %} + {% if view_user.date_of_birth.year != 1900%} + {% trans "age" %} + {% get_age view_user.date_of_birth %} {% trans "age unit" %} + {% endif %} {% endif %} {% if request.user.is_superuser %} diff --git a/forum/views/users.py b/forum/views/users.py index 227cdf6..c64764e 100644 --- a/forum/views/users.py +++ b/forum/views/users.py @@ -16,6 +16,7 @@ from django.core.urlresolvers import reverse from forum.forms import * from forum.utils.html import sanitize_html from forum.authentication import user_updated +from datetime import date import decorators import time @@ -115,7 +116,7 @@ def edit_user(request, id): 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: + if user.date_of_birth == "None": user.date_of_birth = '1900-01-01' user.about = sanitize_html(form.cleaned_data['about'])