mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Fixed form.
This commit is contained in:
@@ -108,14 +108,14 @@ class Domain(AdminObject):
|
||||
|
||||
@property
|
||||
def just_created(self):
|
||||
"""return true if the domain was created in the latest 24h"""
|
||||
"""Return true if the domain was created in the latest 24h."""
|
||||
now = timezone.now()
|
||||
delta = datetime.timedelta(days=1)
|
||||
return self.creation + delta > now
|
||||
|
||||
def awaiting_checks(self):
|
||||
"""return true if the domain has no valid MX records and was created
|
||||
in the latest 24h"""
|
||||
"""Return true if the domain has no valid MX record and was created
|
||||
in the latest 24h."""
|
||||
if (not self.mxrecord_set.has_valids()) and self.just_created:
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -30,7 +30,7 @@ class RelayDomainFormGeneral(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = RelayDomain
|
||||
exclude = ["domain"]
|
||||
exclude = ["domain", "creation", "last_modification"]
|
||||
widgets = {
|
||||
"service": forms.Select(attrs={"class": "form-control"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user