]> git.openstreetmap.org Git - osqa.git/commitdiff
allow the # character in tags, changing the tags regular expression and the error...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sat, 13 Aug 2011 13:02:46 +0000 (13:02 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sat, 13 Aug 2011 13:02:46 +0000 (13:02 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1160 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/forms/qanda.py

index d0e86eca6eb796fe6873d47f2f42b9745569a25f..a81279b2025e3c0103f09e608444b1cb9516dbbc 100644 (file)
@@ -100,12 +100,12 @@ 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'^[\w+\.-]+$', re.UNICODE)
+        tagname_re = re.compile(r'^[\w+#\.-]+$', re.UNICODE)
         for key,tag in list.items():
             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})
             if not tagname_re.match(tag):
-                raise forms.ValidationError(_('please use following characters in tags: letters , numbers, and characters \'.-_\''))
+                raise forms.ValidationError(_('please use following characters in tags: letters , numbers, and characters \'.#-_\''))
             # only keep one same tag
             if tag not in list_temp and len(tag.strip()) > 0:
                 list_temp.append(tag)