Commit 5382ecd0 authored by Michal Čihař's avatar Michal Čihař

Invite people to become translators

parent 3de3122e
...@@ -1250,6 +1250,16 @@ def translate(request, project, subproject, lang): ...@@ -1250,6 +1250,16 @@ def translate(request, project, subproject, lang):
) )
# Invalidate counts cache # Invalidate counts cache
unit.translation.invalidate_cache('suggestions') unit.translation.invalidate_cache('suggestions')
# Invite user to become translator if there is nobody else
recent_changes = Change.objects.filter(
action=Change.ACTION_CHANGE,
translation=unit.translation,
).exclude(user=None).order_by('-timestamp')
if recent_changes.count() == 0 or True:
messages.info(
request,
_('There is currently no active translator for this translation, please consider becoming translator as your suggestion might stay unreviewed otherwise.')
)
# Notify subscribed users # Notify subscribed users
subscriptions = Profile.objects.subscribed_new_suggestion(obj.subproject.project, obj.language, request.user) subscriptions = Profile.objects.subscribed_new_suggestion(obj.subproject.project, obj.language, request.user)
for subscription in subscriptions: for subscription in subscriptions:
......
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