mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
fixed unit tests
This commit is contained in:
@@ -375,8 +375,8 @@ class DomainForm(TabForms):
|
||||
|
||||
"""
|
||||
if "general" in self.instances:
|
||||
self.instances["general"].oldname = self.instances["general"].name
|
||||
self.instances["general"].old_dkim_key_length = self.instances["general"].dkim_key_length
|
||||
instance = self.instances["general"]
|
||||
instance.oldname = instance.name
|
||||
return super(DomainForm, self).is_valid()
|
||||
|
||||
def save(self):
|
||||
|
||||
@@ -25,10 +25,6 @@ def update_domain_mxs_and_mailboxes(sender, instance, **kwargs):
|
||||
return
|
||||
instance.mailbox_set.filter(use_domain_quota=True).update(
|
||||
quota=instance.default_mailbox_quota)
|
||||
if instance.old_dkim_key_length != instance.dkim_key_length:
|
||||
instance.dkim_public_key = ""
|
||||
instance.dkim_private_key_path = ""
|
||||
instance.save()
|
||||
if instance.old_mail_homes is None:
|
||||
return
|
||||
qset = (
|
||||
|
||||
@@ -263,6 +263,9 @@ class Domain(AdminObject):
|
||||
self.old_mail_homes = {
|
||||
mb.id: mb.mail_home for mb in self.mailbox_set.all()
|
||||
}
|
||||
if self.old_dkim_key_length != self.dkim_key_length:
|
||||
self.dkim_public_key = ""
|
||||
self.dkim_private_key_path = ""
|
||||
super(Domain, self).save(*args, **kwargs)
|
||||
|
||||
def delete(self, fromuser, keepdir=False):
|
||||
|
||||
Reference in New Issue
Block a user