diff options
-rw-r--r-- | askbot/deps/django_authopenid/views.py | 8 | ||||
-rw-r--r-- | askbot/mail/__init__.py | 4 | ||||
-rw-r--r-- | askbot/templates/authopenid/email_validation.html | 20 | ||||
-rw-r--r-- | askbot/templates/email/post_as_subthread.html | 6 | ||||
-rw-r--r-- | askbot/templates/email/quoted_post.html | 6 | ||||
-rw-r--r-- | askbot/tests/email_alert_tests.py | 4 |
6 files changed, 27 insertions, 21 deletions
diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py index 5498c792..e5c7df6c 100644 --- a/askbot/deps/django_authopenid/views.py +++ b/askbot/deps/django_authopenid/views.py @@ -46,7 +46,7 @@ from django.utils.encoding import smart_unicode from django.utils.html import escape from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe -from django.core.mail import send_mail +from askbot.mail import send_mail from recaptcha_works.decorators import fix_recaptcha_remote_ip from askbot.skins.loaders import render_into_skin, get_template from askbot.deps.django_authopenid.ldap_auth import ldap_create_user @@ -385,7 +385,7 @@ def signin(request, template_name='authopenid/signin.html'): user_info = ldap_authenticate(username, password) if user_info['success']: if askbot_settings.LDAP_AUTOCREATE_USERS: - #create new user or + #create new user or user = ldap_create_user(user_info).user user = authenticate(method='force', user_id=user.id) assert(user is not None) @@ -404,7 +404,7 @@ def signin(request, template_name='authopenid/signin.html'): user_info['last_name'] return finalize_generic_signin( request, - login_provider_name = 'ldap', + login_provider_name = 'ldap', user_identifier = ldap_username + '@ldap', redirect_url = next_url ) @@ -1179,7 +1179,7 @@ def send_email_key(email, key, handler_url_name='user_account_recover'): reverse(handler_url_name) +\ '?validation_code=' + key } - template = get_template('authopenid/email_validation.txt') + template = get_template('authopenid/email_validation.html') message = template.render(data) send_mail(subject, message, django_settings.DEFAULT_FROM_EMAIL, [email]) diff --git a/askbot/mail/__init__.py b/askbot/mail/__init__.py index d4f83310..2d314dbc 100644 --- a/askbot/mail/__init__.py +++ b/askbot/mail/__init__.py @@ -287,9 +287,7 @@ def process_attachment(attachment): def extract_user_signature(text, reply_code): """extracts email signature as text trailing the reply code""" - #FIXME: buggy in html code - #striped_text = clean_html_email(text.replace('<br>', '\n')) - striped_text = strip_tags(text.replace('<br>', '\n')) + striped_text = strip_tags(text) if reply_code in striped_text: #extract the signature tail = list() diff --git a/askbot/templates/authopenid/email_validation.html b/askbot/templates/authopenid/email_validation.html new file mode 100644 index 00000000..616b285f --- /dev/null +++ b/askbot/templates/authopenid/email_validation.html @@ -0,0 +1,20 @@ +{% extends "email/base_mail.html"%} +{% block title %}{% trans %}Greetings from the Q&A forum{% endtrans %},{%endblock%} +{% block headline%}{% trans %}Greetings from the Q&A forum{% endtrans %},{%endblock%} + +{%block content%} + +<p>{% trans %}To make use of the Forum, please follow the link below:{% endtrans %}</p> + +<p><a href="{{validation_link}}" >{{validation_link}}</a></p> + +<p>{% trans %}Following the link above will help us verify your email address.{% endtrans %}</p> + +<p>{% trans %}If you believe that this message was sent in mistake - +no further action is needed. Just ignore this email, we apologize +for any inconvenience{% endtrans %}</p> +{%endblock%} + +{%block footer %} +{% include "email/footer.html" %} +{% endblock %} diff --git a/askbot/templates/email/post_as_subthread.html b/askbot/templates/email/post_as_subthread.html index f796ff8b..4a4bd047 100644 --- a/askbot/templates/email/post_as_subthread.html +++ b/askbot/templates/email/post_as_subthread.html @@ -1,7 +1,5 @@ -{% extends "email/base_mail.html"%} {% from "email/macros.html" import quoted_post %} -{%block content %} {% if post.post_type in ('question', 'answer') %} {{ quoted_post(post) }} {% set comments = post.get_cached_comments() %} @@ -18,7 +16,3 @@ {% endfor %} {% endif %} {% endif %} -{% endblock %} -{%block footer%} -{% include "email/footer.html" %} -{% endblock %} diff --git a/askbot/templates/email/quoted_post.html b/askbot/templates/email/quoted_post.html index f3015f20..ecc20ad9 100644 --- a/askbot/templates/email/quoted_post.html +++ b/askbot/templates/email/quoted_post.html @@ -1,11 +1,5 @@ -{% extends "email/base_mail.html"%} {% from "email/macros.html" import quoted_post %} -{%block content %} {{ quoted_post( post, quote_level, is_leaf_post = is_leaf_post, format = format ) }} -{% endblock %} -{%block footer %} -{% include "email/footer.html" %} -{% endblock %} diff --git a/askbot/tests/email_alert_tests.py b/askbot/tests/email_alert_tests.py index 5ad08978..1937da6f 100644 --- a/askbot/tests/email_alert_tests.py +++ b/askbot/tests/email_alert_tests.py @@ -1005,10 +1005,10 @@ class PostApprovalTests(utils.AskbotTestCase): u2.approve_post_revision(question.get_latest_revision()) outbox = django.core.mail.outbox - self.assertEquals(len(outbox), 2) + self.assertEquals(len(outbox), 1) #moderation notification self.assertEquals(outbox[0].recipients(), [u1.email,]) - self.assertEquals(outbox[1].recipients(), [u1.email,])#approval + #self.assertEquals(outbox[1].recipients(), [u1.email,])#approval class MailMessagesTests(utils.AskbotTestCase): |