required=False,
))
+SHOW_USER_ACCEPT_RATE = Setting('SHOW_USER_ACCEPT_RATE', True, USERS_SET, dict(
+label = _("Show user accept rate"),
+help_text = _("If you check this the user accept rate will be displayed on the user posts."),
+required=False))
+
TRUNCATE_USERNAMES_LONGER_THAN = Setting('TRUNCATE_USERNAMES_LONGER_THAN', 15, USERS_SET, dict(
label = _("Truncate usernames longer than"),
help_text = _("The usernames that are longer than this will be truncated and ... will be appended.")))
# Usage: {% get_accept_rate node.author %}
@register.simple_tag
def get_accept_rate(user):
+ # If the Show Accept Rate feature is not activated this tag should return a blank string
+ if not settings.SHOW_USER_ACCEPT_RATE:
+ return ""
+
# We get the number of all user's answers.
total_answers_count = Answer.objects.filter(author=user).count()