From 5f966ab241ddcc27f6d94ad0116f52a661ac1778 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 14 Aug 2012 10:37:09 -0400 Subject: emails to groups result in questions posted into the groups --- askbot/mail/__init__.py | 14 ++++++++------ askbot/mail/lamson_handlers.py | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/askbot/mail/__init__.py b/askbot/mail/__init__.py index e653a0e3..01ffb6f0 100644 --- a/askbot/mail/__init__.py +++ b/askbot/mail/__init__.py @@ -325,7 +325,8 @@ def process_parts(parts, reply_code = None): def process_emailed_question( - from_address, subject, body_text, stored_files, tags = None + from_address, subject, body_text, stored_files, + tags=None, group_id=None ): """posts question received by email or bounces the message""" #a bunch of imports here, to avoid potential circular import issues @@ -375,11 +376,12 @@ def process_emailed_question( user.post_question( - title = title, - tags = tagnames.strip(), - body_text = stripped_body_text, - by_email = True, - email_address = from_address + title=title, + tags=tagnames.strip(), + body_text=stripped_body_text, + by_email=True, + email_address=from_address, + group_id=group_id ) else: raise ValidationError() diff --git a/askbot/mail/lamson_handlers.py b/askbot/mail/lamson_handlers.py index 8de3bd71..6bafbc3f 100644 --- a/askbot/mail/lamson_handlers.py +++ b/askbot/mail/lamson_handlers.py @@ -205,7 +205,7 @@ def ASK(message, host = None, addr = None): ) mail.process_emailed_question( from_address, subject, body_text, stored_files, - tags = [group_tag.name, ] + group_id = group_tag.id ) except Tag.DoesNotExist: #do nothing because this handler will match all emails -- cgit v1.2.3-1-g7c22