From: hernani Date: Mon, 7 Jun 2010 00:14:09 +0000 (+0000) Subject: Fixes a bug happening when processing an user reputation more than once in the same... X-Git-Tag: live~752 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/01eed1521a67afc04a8112b44ca4cd1c4a32cf00 Fixes a bug happening when processing an user reputation more than once in the same request cycle. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@380 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/models/action.py b/forum/models/action.py index 1d2e773..77fdae4 100644 --- a/forum/models/action.py +++ b/forum/models/action.py @@ -289,11 +289,11 @@ class ActionRepute(models.Model): def save(self, *args, **kwargs): super(ActionRepute, self).save(*args, **kwargs) - self.user.reputation += self.value + self.user.reputation = models.F('reputation') + self.value self.user.save() def delete(self): - self.user.reputation -= self.value + self.user.reputation = models.F('reputation') - self.value self.user.save() super(ActionRepute, self).delete()