From f55ce1caabe9a75982c895b5f78989834accec3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 7 Jun 2016 12:01:23 +0200 Subject: [PATCH] [Backport] Fix race condition on projects refresh totals --- taiga/projects/models.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/taiga/projects/models.py b/taiga/projects/models.py index beddffd9..8aa5561c 100644 --- a/taiga/projects/models.py +++ b/taiga/projects/models.py @@ -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):