summaryrefslogtreecommitdiffstats
path: root/askbot/mail/lamson_handlers.py
diff options
context:
space:
mode:
Diffstat (limited to 'askbot/mail/lamson_handlers.py')
-rw-r--r--askbot/mail/lamson_handlers.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/askbot/mail/lamson_handlers.py b/askbot/mail/lamson_handlers.py
index 5008918e..728203e6 100644
--- a/askbot/mail/lamson_handlers.py
+++ b/askbot/mail/lamson_handlers.py
@@ -278,21 +278,19 @@ def PROCESS(
#2) process body text and email signature
user = reply_address_object.user
- if signature is not None:#if there, then it was stripped
- if signature != user.email_signature:
- user.email_signature = signature
- else:#try to strip signature
- stripped_body_text = user.strip_email_signature(body_text)
- #todo: add test cases for emails without the signature
- if stripped_body_text == body_text and user.email_signature:
- #todo: send an email asking to update the signature
- raise ValueError('email signature changed or unknown')
- body_text = stripped_body_text
-
- #3) validate email address and save user
+
+ if signature != user.email_signature:
+ user.email_signature = signature
+
+ #3) validate email address and save user along with maybe new signature
user.email_isvalid = True
user.save()#todo: actually, saving is not necessary, if nothing changed
+ #here we might be in danger of chomping off some of the
+ #message is body text ends with a legitimate text coinciding with
+ #the user's email signature
+ body_text = user.strip_email_signature(body_text)
+
#4) actually make an edit in the forum
robj = reply_address_object
add_post_actions = ('post_comment', 'post_answer', 'auto_answer_or_comment')