]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/forms/qanda.py
"Contact Us" requires an email address if the user is anonymous
[osqa.git] / forum / forms / qanda.py
index f38a382f3c1e675d37715873a70a873188b6ffb5..d54eabb7cdeed00baf2e9490378170ed62deff00 100644 (file)
@@ -87,7 +87,7 @@ class TagNamesField(forms.CharField):
 
         list_temp = []
         tagname_re = re.compile(r'^[\w+\.-]+$', re.UNICODE)
 
         list_temp = []
         tagname_re = re.compile(r'^[\w+\.-]+$', re.UNICODE)
-        for key,tag in list:
+        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):
             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):
@@ -136,7 +136,7 @@ class SummaryField(forms.CharField):
 
 class FeedbackForm(forms.Form):
     name = forms.CharField(label=_('Your name:'), required=False)
 
 class FeedbackForm(forms.Form):
     name = forms.CharField(label=_('Your name:'), required=False)
-    email = forms.EmailField(label=_('Email (not shared with anyone):'), required=False)
+    email = forms.EmailField(label=_('Email (not shared with anyone):'), required=True)
     message = forms.CharField(label=_('Your message:'), max_length=800,widget=forms.Textarea(attrs={'cols':60}))
     next = NextUrlField()
 
     message = forms.CharField(label=_('Your message:'), max_length=800,widget=forms.Textarea(attrs={'cols':60}))
     next = NextUrlField()