VMM: Solve the default "misc.quota_bytes = '0'" problem where it may occur. v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Fri, 18 Feb 2011 12:12:54 +0000
branchv0.6.x
changeset 407 3162ff959375
parent 406 58e23bd7c97f
child 408 f6e55b27fe07
VMM: Solve the default "misc.quota_bytes = '0'" problem where it may occur.
VirtualMailManager/handler.py
VirtualMailManager/quotalimit.py
--- a/VirtualMailManager/handler.py	Fri Feb 18 01:15:03 2011 +0000
+++ b/VirtualMailManager/handler.py	Fri Feb 18 12:12:54 2011 +0000
@@ -431,7 +431,7 @@
         else:
             dom.set_transport(Transport(self._dbh, transport=transport))
         dom.set_quotalimit(QuotaLimit(self._dbh,
-                           bytes=self._cfg.dget('misc.quota_bytes'),
+                           bytes=long(self._cfg.dget('misc.quota_bytes')),
                            messages=self._cfg.dget('misc.quota_messages')))
         dom.set_directory(self._cfg.dget('misc.base_directory'))
         dom.save()
--- a/VirtualMailManager/quotalimit.py	Fri Feb 18 01:15:03 2011 +0000
+++ b/VirtualMailManager/quotalimit.py	Fri Feb 18 12:12:54 2011 +0000
@@ -55,8 +55,6 @@
             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_