summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-04-10 11:53:04 -0500
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-04-10 11:53:04 -0500
commitbfa1229693151aa454ef9c176816581a5a52d624 (patch)
treecbd626a06d460f785d87444dbaf10d1fbcfb32e0
parent4d97551d6fe4db7a01cb0349e7fe0514b5d2906d (diff)
downloadaskbot-bfa1229693151aa454ef9c176816581a5a52d624.tar.gz
askbot-bfa1229693151aa454ef9c176816581a5a52d624.tar.bz2
askbot-bfa1229693151aa454ef9c176816581a5a52d624.zip
removed the reply divider in the case reply-by-email feature is disabled
-rw-r--r--askbot/models/__init__.py9
1 files changed, 8 insertions, 1 deletions
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': '<a href="%s">%s</a>' % (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 % {