diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-02 18:28:20 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-02 18:28:20 -0400 |
commit | da20707172cce592c61ae455a8a89190fb012c92 (patch) | |
tree | 8c23e13ef4ee160a2d0459637f2b3b8d7830ce00 | |
parent | a4692d9cb97154ee172185efbeedc374def6dcd0 (diff) | |
download | askbot-da20707172cce592c61ae455a8a89190fb012c92.tar.gz askbot-da20707172cce592c61ae455a8a89190fb012c92.tar.bz2 askbot-da20707172cce592c61ae455a8a89190fb012c92.zip |
fix to asking by email and another one to prevent creation of "blank" tags
-rw-r--r-- | askbot/lamson_handlers.py | 6 | ||||
-rw-r--r-- | askbot/models/question.py | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/askbot/lamson_handlers.py b/askbot/lamson_handlers.py index 1d4bb1bc..34f93a7b 100644 --- a/askbot/lamson_handlers.py +++ b/askbot/lamson_handlers.py @@ -114,9 +114,11 @@ def get_parts(message): parts.append((part_type, part_content)) return parts -@route('(addr)@(host)') +@route('(addr)@(host)', addr = '.+') @stateless def ASK(message, host = None, addr = None): + if addr.startswith('reply-'): + return parts = get_parts(message) from_address = message.From subject = message['Subject']#why lamson does not give it normally? @@ -128,7 +130,7 @@ def ASK(message, host = None, addr = None): try: group_tag = Tag.group_tags.get( deleted = False, - name = addr + name_iexact = addr ) mail.process_emailed_question( from_address, subject, parts, tags = [group_tag.name, ] diff --git a/askbot/models/question.py b/askbot/models/question.py index 9481d3ac..4e590d94 100644 --- a/askbot/models/question.py +++ b/askbot/models/question.py @@ -676,7 +676,7 @@ class Thread(models.Model): previous_tags = list(self.tags.all()) previous_tagnames = set([tag.name for tag in previous_tags]) - updated_tagnames = set(t for t in tagnames.split(' ')) + updated_tagnames = set(t for t in tagnames.strip().split(' ')) removed_tagnames = previous_tagnames - updated_tagnames added_tagnames = updated_tagnames - previous_tagnames @@ -751,7 +751,7 @@ class Thread(models.Model): thread_question = self._question_post() - self.tagnames = tagnames + self.tagnames = tagnames.strip() self.save() # Update the Question itself |