From cef6a23e58cb81e28be2dc2f77fd35eac89c3060 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 24 Apr 2013 03:08:35 -0400 Subject: a change in posting by email --- askbot/mail/__init__.py | 8 +++++++- askbot/mail/lamson_handlers.py | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/askbot/mail/__init__.py b/askbot/mail/__init__.py index 352711b6..d72cc890 100644 --- a/askbot/mail/__init__.py +++ b/askbot/mail/__init__.py @@ -312,7 +312,13 @@ def extract_user_signature(text, reply_code): while tail and (tail[0].startswith('>') or tail[0].strip() == ''): tail.pop(0) - return '\n'.join(tail) + signature = '\n'.join(tail) + + #patch signature to a sentinel value if it is truly empty, because we + #cannot allow empty signature field, which indicates no + #signature at all and in that case we ask user to create one + if signature == '': + signature = 'empty signature' else: return None diff --git a/askbot/mail/lamson_handlers.py b/askbot/mail/lamson_handlers.py index 0bc828c5..5008918e 100644 --- a/askbot/mail/lamson_handlers.py +++ b/askbot/mail/lamson_handlers.py @@ -229,12 +229,6 @@ def VALIDATE_EMAIL( try: content, stored_files, signature = mail.process_parts(parts, reply_code) - #patch signature to a sentinel value if it is truly empty, because we - #cannot allow empty signature field, which indicates no - #signature at all and in that case we ask user to create one - if signature == '': - signature = 'empty signature' - user = reply_address_object.user if signature != user.email_signature: -- cgit v1.2.3-1-g7c22