Commit e6647c84 by Asad Azam Committed by AsadAzam

Fixed incorrect commenter identification

parent 060c174e
......@@ -4,7 +4,7 @@
<!-- Message Body -->
<p>
{% blocktrans with date=comment_date|date:'m/d/y' time=comment_date.time trimmed %}
The {{ team_name }} made the following comment on {{ course_name }} on {{ date }} at {{ time }}
{{ user_name }} made the following comment on {{ course_name }} on {{ date }} at {{ time }}
{% endblocktrans %}
</p>
<p style="font-style: italic;">
......
{% load i18n %}
{% blocktrans with date=comment_date|date:'m/d/y' time=comment_date.time trimmed %}
The {{ team_name }} made the following comment on {{ course_name }} {{ date }} at {{ time }}.
{{ user_name }} made the following comment on {{ course_name }} {{ date }} at {{ time }}.
{% endblocktrans %}
{{ comment_message }}
......
......@@ -72,7 +72,7 @@ def send_email_for_comment(comment, created=False):
context = {
'comment_message': comment.comment,
'team_name': 'course team' if comment.user == course.course_team_admin else 'marketing team',
'user_name': comment.user.username,
'course_name': course_name,
'comment_date': comment_date,
'page_url': 'https://{host}{path}'.format(host=comment.site.domain.strip('/'), path=object_path)
......
......@@ -135,7 +135,8 @@ class CommentsEmailTests(SiteMixin, TestCase):
else:
course_name = content_object.title
expected = 'The marketing team made the following comment on {course_name}'.format(course_name=course_name)
expected = '{username} made the following comment on {course_name}'.format(username=comment.user.username,
course_name=course_name)
self.assertIn(expected, body)
page_url = 'https://{host}{path}'.format(host=comment.site.domain.strip('/'), path=object_path)
self.assertIn(comment.comment, body)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment