]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixing OSQA 112, and an error originated by the last checkin.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 17 May 2010 14:13:05 +0000 (14:13 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 17 May 2010 14:13:05 +0000 (14:13 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@291 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/forms.py
forum/templatetags/user_tags.py

index 509c1255dd5578aebce63017f75789f8756d97fe..6e736b9a7c9512069770d2f7af3ca307df7e70ad 100644 (file)
@@ -57,7 +57,7 @@ class TagNamesField(forms.CharField):
 
     def clean(self, value):
         value = super(TagNamesField, self).clean(value)
-        data = value.strip()
+        data = value.strip().lower()
 
         split_re = re.compile(r'[ ,]+')
         list = split_re.split(data)
@@ -66,7 +66,7 @@ class TagNamesField(forms.CharField):
             raise forms.ValidationError(_('please use between %(min)s and %(max)s tags') % { 'min': settings.FORM_MIN_NUMBER_OF_TAGS, 'max': settings.FORM_MAX_NUMBER_OF_TAGS})
 
         list_temp = []
-        tagname_re = re.compile(r'[a-z0-9]+')
+        tagname_re = re.compile(r'^[\w+\.-]$', re.UNICODE)
         for tag in list:
             if len(tag) > settings.FORM_MAX_LENGTH_OF_TAG or len(tag) < settings.FORM_MIN_LENGTH_OF_TAG:
                 raise forms.ValidationError(_('please use between %(min)s and %(max)s characters in you tags') % { 'min': settings.FORM_MIN_LENGTH_OF_TAG, 'max': settings.FORM_MAX_LENGTH_OF_TAG})
index 27535f6d383f483e659f84699b92f7c1d5f8b055..cd22f26bcb6913828577335ccaaea3540a9b7720 100644 (file)
@@ -1,7 +1,6 @@
 from django import template\r
 from django.utils.translation import ugettext as _\r
 from django.utils.safestring import mark_safe\r
-from forum.forms import AwardPointsForm\r
 import logging\r
 \r
 register = template.Library()\r