diff options
-rw-r--r-- | askbot/models/reply_by_email.py | 27 | ||||
-rw-r--r-- | askbot/utils/mail.py | 3 |
2 files changed, 24 insertions, 6 deletions
diff --git a/askbot/models/reply_by_email.py b/askbot/models/reply_by_email.py index a8769307..d329d38b 100644 --- a/askbot/models/reply_by_email.py +++ b/askbot/models/reply_by_email.py @@ -72,7 +72,8 @@ class ReplyAddress(models.Model): self.user.edit_post( post = self.response_post, body_text = content, - revision_comment = _('edited by email') + revision_comment = _('edited by email'), + by_email = True ) self.response_post.thread.invalidate_cached_data() @@ -85,15 +86,31 @@ class ReplyAddress(models.Model): content, stored_files = mail.process_parts(parts) if self.post.post_type == 'answer': - result = self.user.post_comment(self.post, content) + result = self.user.post_comment( + self.post, + content, + by_email = True + ) elif self.post.post_type == 'question': wordcount = len(content)/6#this is a simplistic hack if wordcount > askbot_settings.MIN_WORDS_FOR_ANSWER_BY_EMAIL: - result = self.user.post_answer(self.post, content) + result = self.user.post_answer( + self.post, + content, + by_email = True + ) else: - result = self.user.post_comment(self.post, content) + result = self.user.post_comment( + self.post, + content, + by_email = True + ) elif self.post.post_type == 'comment': - result = self.user.post_comment(self.post.parent, content) + result = self.user.post_comment( + self.post.parent, + content, + by_email = True + ) result.thread.invalidate_cached_data() self.response_post = result self.used_at = datetime.now() diff --git a/askbot/utils/mail.py b/askbot/utils/mail.py index a09d8e0d..744c54de 100644 --- a/askbot/utils/mail.py +++ b/askbot/utils/mail.py @@ -278,7 +278,8 @@ def process_emailed_question(from_address, subject, parts): user.post_question( title = title, tags = tagnames, - body_text = body_text + body_text = body_text, + by_email = True ) else: raise ValidationError() |