From 59af35e4a754b50c801c8dc25aeadd06eaef35a4 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 5 Jun 2012 06:58:29 -0400 Subject: small corrections in the bounce email --- askbot/mail/__init__.py | 7 ++++--- .../default/templates/email/insufficient_rep_to_post_by_email.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/askbot/mail/__init__.py b/askbot/mail/__init__.py index 7e3abbf6..ddf909a7 100644 --- a/askbot/mail/__init__.py +++ b/askbot/mail/__init__.py @@ -208,7 +208,7 @@ def bounce_email(email, subject, reason = None, body_text = None): 'site': askbot_settings.APP_SHORT_NAME, 'url': url_utils.get_login_url() } - elif reason == 'permission_denied': + elif reason == 'permission_denied' and body_text: error_message = _( '

Sorry, your question could not be posted ' 'due to insufficient privileges of your user account

' @@ -216,7 +216,7 @@ def bounce_email(email, subject, reason = None, body_text = None): else: raise ValueError('unknown reason to bounce an email: "%s"' % reason) - if body_text != None: + if body_text: error_message = string_concat(error_message, body_text) #print 'sending email' @@ -337,7 +337,8 @@ def process_emailed_question( #todo: factor this code out template = get_template('email/insufficient_rep_to_post_by_email.html') min_rep = askbot_settings.MIN_REP_TO_POST_BY_EMAIL - min_upvotes = min_rep / askbot_settings.REP_GAIN_FOR_RECEIVING_UPVOTE + min_upvotes = 1 + \ + (min_rep/askbot_settings.REP_GAIN_FOR_RECEIVING_UPVOTE) data = { 'username': user.username, 'site_name': askbot_settings.APP_SHORT_NAME, diff --git a/askbot/skins/default/templates/email/insufficient_rep_to_post_by_email.html b/askbot/skins/default/templates/email/insufficient_rep_to_post_by_email.html index 071cbbdf..0abd8e63 100644 --- a/askbot/skins/default/templates/email/insufficient_rep_to_post_by_email.html +++ b/askbot/skins/default/templates/email/insufficient_rep_to_post_by_email.html @@ -4,7 +4,7 @@ * username * site_name - for the footer #} -

+

{% trans %}{{ username }}, your question could not be posted by email just yet{% endtrans %}

-- cgit v1.2.3-1-g7c22