From 3fd332219cd2504a472b6244c086dc4694d9daf4 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] 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 060fbdb8..4a369c8d 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):