[Backport] Fix race condition on projects refresh totals

remotes/origin/issue/4795/notification_even_they_are_disabled
Jesús Espino 2016-06-07 12:01:23 +02:00 committed by David Barragán Merino
parent f27859af74
commit f55ce1caab
1 changed files with 11 additions and 1 deletions

View File

@ -339,7 +339,17 @@ class Project(ProjectDefaults, TaggedMixin, models.Model):
self.total_activity_last_year = qs_year.count()
if save:
self.save()
self.save(update_fields=[
'totals_updated_datetime',
'total_fans',
'total_fans_last_week',
'total_fans_last_month',
'total_fans_last_year',
'total_activity',
'total_activity_last_week',
'total_activity_last_month',
'total_activity_last_year',
])
@cached_property
def cached_user_stories(self):