Fixed form.

This commit is contained in:
Antoine Nguyen
2016-11-05 14:53:11 +01:00
parent 84326aa706
commit 784acaca46
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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"})
}