]> git.openstreetmap.org Git - osqa.git/commitdiff
Don't let reputation go 0, it may cause mysql to overflow.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sat, 9 Apr 2011 02:07:10 +0000 (02:07 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sat, 9 Apr 2011 02:07:10 +0000 (02:07 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@944 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/action.py

index dc29a024f75d3a1fbf814811650ec5cbb7a6efdb..58ec7d55f145b90331128d86f66909c2f9ffebf9 100644 (file)
@@ -300,7 +300,7 @@ class ActionRepute(models.Model):
         return 0
 
     def _add_to_rep(self, value):
         return 0
 
     def _add_to_rep(self, value):
-        if self.user.reputation + value < 0:
+        if self.user.reputation + value < 1:
             return 0
         else:
             return models.F('reputation') + value
             return 0
         else:
             return models.F('reputation') + value