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)
self.fields['name'] = forms.CharField(label=_('Your name:'), required=False)
self.fields['email'] = forms.EmailField(label=_('Email (not shared with anyone):'), required=True)
+ # Create anti spam fields
+ spam_fields = call_all_handlers('create_anti_spam_field')
+ if spam_fields:
+ spam_fields = dict(spam_fields)
+ for name, field in spam_fields.items():
+ self.fields[name] = field
+
+ self._anti_spam_fields = spam_fields.keys()
+ else:
+ self._anti_spam_fields = []
+
class AskForm(forms.Form):