summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-03-16 04:43:36 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-03-16 04:43:36 -0400
commit49f0e7d503eb83c1359ba6f90d68fc5e38ec5300 (patch)
tree1f400d3af07bdd456d3b569bfcecbbe9f0f2fc15
parent0bdda198437d9406f1526114dc50e7fd1910ee37 (diff)
downloadaskbot-49f0e7d503eb83c1359ba6f90d68fc5e38ec5300.tar.gz
askbot-49f0e7d503eb83c1359ba6f90d68fc5e38ec5300.tar.bz2
askbot-49f0e7d503eb83c1359ba6f90d68fc5e38ec5300.zip
hopefully made error messages more uderstandable when asking by email
-rw-r--r--askbot/forms.py7
-rw-r--r--askbot/utils/mail.py7
2 files changed, 12 insertions, 2 deletions
diff --git a/askbot/forms.py b/askbot/forms.py
index 84f21516..437b7fff 100644
--- a/askbot/forms.py
+++ b/askbot/forms.py
@@ -682,7 +682,12 @@ class AskByEmailForm(forms.Form):
title = match.group(2).strip()
self.cleaned_data['title'] = TitleField().clean(title)
else:
- raise forms.ValidationError('could not parse subject line')
+ raise forms.ValidationError(
+ _(
+ 'Subject line is expected in the format: '
+ '[tag1, tag2, tag3,...] question title'
+ )
+ )
return self.cleaned_data['subject']
class AnswerForm(forms.Form):
diff --git a/askbot/utils/mail.py b/askbot/utils/mail.py
index 1032b309..3d8298d5 100644
--- a/askbot/utils/mail.py
+++ b/askbot/utils/mail.py
@@ -261,9 +261,14 @@ def process_emailed_question(from_address, subject, body, attachments = None):
body_text = unicode(error)
)
else:
+ error_list = list()
+ for field_errors in form.errors.values():
+ error_list.extend(field_errors)
+
if email_address:
bounce_email(
email_address,
subject,
- reason = 'problem_posting'
+ reason = 'problem_posting',
+ body_text = '\n*'.join(error_list)
)