mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Don't allow mailbox quota values greater than the domain's one.
fix #401
This commit is contained in:
@@ -719,8 +719,12 @@ class Mailbox(DatesAware):
|
||||
raise AdminError(_("Failed to remove mailbox: %s" % output))
|
||||
|
||||
def set_quota(self, value, override_domain=False):
|
||||
if value is None or (int(value) > self.domain.quota and not override_domain):
|
||||
if value is None:
|
||||
self.quota = self.domain.quota
|
||||
elif int(value) > self.domain.quota and not override_domain:
|
||||
raise AdminError(
|
||||
_("Quota is greater than the allowed domain's limit (%dM)" % self.domain.quota)
|
||||
)
|
||||
else:
|
||||
self.quota = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user