A super administrator can define an empty quota.

fixes #433
This commit is contained in:
Antoine Nguyen
2013-07-25 12:28:22 +02:00
parent f8de2e7994
commit 2026a425a8
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ class DomainFormOptions(forms.Form):
da.post_create(user)
mb = Mailbox(address=self.cleaned_data["dom_admin_username"], domain=domain,
user=da, use_domain_quota=True)
mb.set_quota()
mb.set_quota(override_rules=user.has_perm("admin.change_domain"))
mb.save(creator=user)
if self.cleaned_data["create_aliases"] == "yes":
+15
View File
@@ -55,6 +55,21 @@ class DomainTestCase(ModoTestCase):
self.assertIn(da.mailbox_set.all()[0], al.mboxes.all())
self.assertTrue(da.can_access(al))
def test_create_with_template_and_empty_quota(self):
"""Test the creation of a domain with a template and no quota"""
values = {
"name": "pouet.com", "quota": 0, "create_dom_admin": "yes",
"dom_admin_username": "toto", "create_aliases": "yes",
"stepid": 2
}
self.check_ajax_post(reverse("modoboa.admin.views.newdomain"), values)
dom = Domain.objects.get(name="pouet.com")
da = User.objects.get(username="toto@pouet.com")
self.assertIn(da, dom.admins)
al = Alias.objects.get(address="postmaster", domain__name="pouet.com")
self.assertIn(da.mailbox_set.all()[0], al.mboxes.all())
self.assertTrue(da.can_access(al))
def test_modify(self):
"""Test the modification of a domain