Commit c4db9048 authored by Michal Čihař's avatar Michal Čihař

Improved suggestion notifications

parent 9a362daa
......@@ -234,7 +234,7 @@ class Profile(models.Model):
translation,
)
def notify_new_suggestion(self, translation, suggestion):
def notify_new_suggestion(self, translation, suggestion, unit):
'''
Sends notification on new suggestion.
'''
......@@ -243,6 +243,7 @@ class Profile(models.Model):
translation,
{
'suggestion': suggestion,
'unit': unit,
}
)
......
......@@ -5,9 +5,9 @@ there is new suggestion evaluate on {{ translation }} at {{ site_title }}.
{% trans "Source string:" %}
{{ suggestion.get_source }}
{{ unit.source }}
{% trans "Translation:" %}
{% trans "Suggestion:" %}
{{ suggestion.target }}
......
......@@ -1263,7 +1263,7 @@ def translate(request, project, subproject, lang):
# Notify subscribed users
subscriptions = Profile.objects.subscribed_new_suggestion(obj.subproject.project, obj.language, request.user)
for subscription in subscriptions:
subscription.notify_new_suggestion(obj, sug)
subscription.notify_new_suggestion(obj, sug, unit)
# Update suggestion stats
if profile is not None:
profile.suggested += 1
......
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