summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-07-14 06:02:57 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-07-14 06:02:57 -0300
commit2f068799aa50fad58e1f827ea4f9ca7ef5d6574f (patch)
tree16d9e02428326fe376432e623963fdcd4be89c4b
parentd26ab50da99b50bdd6e6cdb9dc60bceed8553def (diff)
downloadaskbot-2f068799aa50fad58e1f827ea4f9ca7ef5d6574f.tar.gz
askbot-2f068799aa50fad58e1f827ea4f9ca7ef5d6574f.tar.bz2
askbot-2f068799aa50fad58e1f827ea4f9ca7ef5d6574f.zip
a bugfix is the feedback form with email opt-out
-rw-r--r--askbot/forms.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/askbot/forms.py b/askbot/forms.py
index ce189440..e7e869cd 100644
--- a/askbot/forms.py
+++ b/askbot/forms.py
@@ -775,8 +775,9 @@ class FeedbackForm(forms.Form):
def clean(self):
super(FeedbackForm, self).clean()
if self.user and self.user.is_anonymous():
- if not self.cleaned_data['no_email'] \
- and not self.cleaned_data['email']:
+ need_email = not bool(self.cleaned_data.get('no_email', False))
+ email = self.cleaned_data.get('email', '').strip()
+ if need_email and email == '':
msg = _('Please mark "I dont want to give my mail" field.')
self._errors['email'] = self.error_class([msg])