diff options
-rw-r--r-- | askbot/models/__init__.py | 3 | ||||
-rw-r--r-- | askbot/templates/email/macros.html | 20 | ||||
-rw-r--r-- | askbot/views/writers.py | 2 |
3 files changed, 16 insertions, 9 deletions
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index e019826f..b784d0c5 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -612,10 +612,11 @@ def user_assert_can_unaccept_best_answer(self, answer = None): return else: + question_owner = answer.thread._question_post().get_owner() error_message = _( 'Sorry, only moderators or original author of the question ' ' - %(username)s - can accept or unaccept the best answer' - ) % {'username': answer.get_owner().username} + ) % {'username': question_owner.username} raise django_exceptions.PermissionDenied(error_message) diff --git a/askbot/templates/email/macros.html b/askbot/templates/email/macros.html index 125705e2..77345a45 100644 --- a/askbot/templates/email/macros.html +++ b/askbot/templates/email/macros.html @@ -9,7 +9,11 @@ {{ start_quote(quote_level) }} {% set author = post.author.username|escape %} {% if post.post_type == 'question' %} + {% if quote_level > 0 %} <p style="font-size:10px; font-weight: bold;"> + {% else %} + <p style="font-size:20px; font-weight: bold; margin: 10px 0"> + {% endif %} {% if format == 'parent_subthread' %} {% if is_leaf_post %} {% trans %}Question by {{ author }}:{% endtrans %} @@ -23,18 +27,20 @@ {% endif %} {{ post.thread.title }} </p> + {% if quote_level > 0 %} <p style="font-size:10px; font-weight: bold;"> {% if format != 'parent_subthread' %} {% trans %}Asked by {{ author }}:{% endtrans %} {% endif %} </p> - {% set tag_names = post.get_tag_names() %} - {% if tag_names %} - <p style="font-size:10px; font-style:italic;"> - {% trans %}Tags:{% endtrans %} - {{ tag_names|join(', ') }}. - </p> - {% endif %} + {% endif %} + {% set tag_names = post.get_tag_names() %} + {% if tag_names %} + <p style="font-size:10px; font-style:italic;"> + {% trans %}Tags:{% endtrans %} + {{ tag_names|join(', ') }}. + </p> + {% endif %} {% elif post.post_type == 'answer' %} <p style="font-size:10px; font-weight: bold;"> {% if format == 'parent_subthread' %} diff --git a/askbot/views/writers.py b/askbot/views/writers.py index f77ed58c..b581036c 100644 --- a/askbot/views/writers.py +++ b/askbot/views/writers.py @@ -798,7 +798,7 @@ def answer_to_comment(request): message = _( 'Cannot convert, because text has more characters than ' '%(max_chars)s - maximum allowed for comments' - ) % askbot_settings.MAX_COMMENT_LENGTH + ) % {'max_chars': askbot_settings.MAX_COMMENT_LENGTH} request.user.message_set.create(message=message) return HttpResponseRedirect(answer.get_absolute_url()) |