Default mailbox quota should not be greater than quota.

see #1035
This commit is contained in:
Antoine Nguyen
2017-02-20 16:57:38 +01:00
parent c677de4e17
commit 6ecb50deab
3 changed files with 23 additions and 0 deletions
+5
View File
@@ -265,6 +265,11 @@ class Domain(AdminObject):
_("Invalid default mailbox quota value for domain '{}'")
.format(self.name)
)
if self.quota != 0 and self.default_mailbox_quota > self.quota:
raise BadRequest(
_("Default mailbox quota cannot be greater than domain "
"quota")
)
self.enabled = (row[4].strip() in ["True", "1", "yes", "y"])
core_signals.can_create_object.send(
sender=self.__class__, context=user, klass=Domain,