summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo Fitoria <adolfo.fitoria@gmail.com>2013-01-31 09:40:22 -0600
committerAdolfo Fitoria <adolfo.fitoria@gmail.com>2013-01-31 09:40:22 -0600
commit6b15b408034289611027d05523f7285be3978bab (patch)
tree41763db408354b3dfcbbc4a14e2eb358414066aa
parentaebaf03ff1a4bc2b53798288c85e9eecf3fb3577 (diff)
parent0e21c56c275fa99ccbed2cb85e341c85178bba9d (diff)
downloadaskbot-6b15b408034289611027d05523f7285be3978bab.tar.gz
askbot-6b15b408034289611027d05523f7285be3978bab.tar.bz2
askbot-6b15b408034289611027d05523f7285be3978bab.zip
Merge branch 'master' of github.com:ASKBOT/askbot-devel
-rw-r--r--askbot/models/__init__.py3
-rw-r--r--askbot/templates/email/macros.html20
-rw-r--r--askbot/views/writers.py2
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())