Make sure to load types at runtime.

see #831
This commit is contained in:
Antoine Nguyen
2016-02-04 08:41:42 +01:00
parent ba4225f600
commit 4733622ff8
+4 -2
View File
@@ -22,7 +22,6 @@ from ..models import (
DOMAIN_TYPES = [
("domain", _("Domain")),
]
DOMAIN_TYPES += events.raiseQueryEvent("ExtraDomainTypes")
class DomainFormGeneral(forms.ModelForm, DynamicForm):
@@ -30,7 +29,7 @@ class DomainFormGeneral(forms.ModelForm, DynamicForm):
"""A form to create/edit a domain."""
type = forms.ChoiceField(
label=ugettext_lazy("Type"), choices=DOMAIN_TYPES
label=ugettext_lazy("Type"),
)
quota = forms.IntegerField(
label=ugettext_lazy("Quota"),
@@ -59,6 +58,9 @@ class DomainFormGeneral(forms.ModelForm, DynamicForm):
self.oldname = kwargs["instance"].name
super(DomainFormGeneral, self).__init__(*args, **kwargs)
self.fields["type"].choices = (
DOMAIN_TYPES + events.raiseQueryEvent("ExtraDomainTypes"))
self.field_widths = {
"quota": 3
}