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

Update user stats on same time as generating Change object (thus accounting...

Update user stats on same time as generating Change object (thus accounting every change in suprojects, not counting all just once)
parent 56e58e90
......@@ -2597,6 +2597,11 @@ class Unit(models.Model):
for subscription in subscriptions:
subscription.notify_any_translation(self, oldunit)
# Update user stats
profile = request.user.get_profile()
profile.translated += 1
profile.save()
# Notify about new contributor
if not Change.objects.filter(translation=self.translation, user=request.user).exists():
# Get list of subscribers for new contributor
......
......@@ -1365,10 +1365,6 @@ def translate(request, project, subproject, lang):
saved = unit.save_backend(request)
if saved:
# Update userstats
profile.translated += 1
profile.save()
# Get new set of checks
newchecks = set(
unit.active_checks().values_list('check', flat=True)
......
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