VMM/quotalimit: Don't fail in QuotaLimit.__init__, if we get the v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Sat, 12 Feb 2011 18:12:37 +0000
branchv0.6.x
changeset 400 0512d940918f
parent 399 fb22773f7a85
child 401 00a8c12a3da3
VMM/quotalimit: Don't fail in QuotaLimit.__init__, if we get the deafult misc.quota_bytes value: '0'.
VirtualMailManager/quotalimit.py
--- a/VirtualMailManager/quotalimit.py	Sat Feb 12 17:19:43 2011 +0000
+++ b/VirtualMailManager/quotalimit.py	Sat Feb 12 18:12:37 2011 +0000
@@ -55,6 +55,8 @@
             self._load_by_qid(qid)
         else:
             bytes_, msgs = kwargs.get('bytes'), kwargs.get('messages')
+            if bytes_ == '0':  # default from Config
+                bytes_ = 0
             assert all(isinstance(i, (int, long)) for i in (bytes_, msgs))
             if bytes_ < 0:
                 self._bytes = -bytes_