Use float precision to compute the quota usage.

see #391
This commit is contained in:
Antoine Nguyen
2013-04-13 14:59:45 +02:00
parent 15ab1c46df
commit 28a33c85b7
+1 -1
View File
@@ -728,7 +728,7 @@ class Mailbox(DatesAware):
if not self.quota:
return 0
q = Quota.objects.get(username=self.full_address)
return q.bytes / (self.quota * 1048576) * 100
return int(q.bytes / float(self.quota * 1048576) * 100)
def save_from_user(self, localpart, domain, user, quota=None, owner=None):
"""Simple save method called for automatic creations