From bfa1229693151aa454ef9c176816581a5a52d624 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 10 Apr 2012 11:53:04 -0500 Subject: removed the reply divider in the case reply-by-email feature is disabled --- askbot/models/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index 3774bc7d..14989adb 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -263,6 +263,12 @@ def user_can_have_strong_url(self): followed by the search engine crawlers""" return (self.reputation >= askbot_settings.MIN_REP_TO_HAVE_STRONG_URL) +def user_can_reply_by_email(self): + """True, if reply by email is enabled + and user has sufficient reputatiton""" + return askbot_settings.REPLY_BY_EMAIL and \ + self.reputation > askbot_settings.MIN_REP_TO_POST_BY_EMAIL + def _assert_user_can( user = None, post = None, #related post (may be parent) @@ -2345,6 +2351,7 @@ User.add_to_class('is_following_question', user_is_following_question) User.add_to_class('mark_tags', user_mark_tags) User.add_to_class('update_response_counts', user_update_response_counts) User.add_to_class('can_have_strong_url', user_can_have_strong_url) +User.add_to_class('can_reply_by_email', user_can_reply_by_email) User.add_to_class('can_post_comment', user_can_post_comment) User.add_to_class('is_administrator', user_is_administrator) User.add_to_class('is_administrator_or_moderator', user_is_administrator_or_moderator) @@ -2509,7 +2516,7 @@ def format_instant_notification_email( 'post_link': '%s' % (post_url, _(post.post_type)) } - can_reply = to_user.reputation > askbot_settings.MIN_REP_TO_POST_BY_EMAIL + can_reply = to_user.can_reply_by_email() if can_reply: reply_separator = const.REPLY_SEPARATOR_TEMPLATE % { -- cgit v1.2.3-1-g7c22