Use ThemableChoiceField

There are still remain some ChoiceField that have not covered.

Closes-Bug: #1732317
Change-Id: Ib9be4f252eba08374f87e4fef5e702a6ea8c1226
This commit is contained in:
Cao Xuan Hoang 2017-11-14 13:42:22 +07:00
parent d768502abf
commit f7eec152c2
3 changed files with 9 additions and 8 deletions

View File

@ -24,8 +24,8 @@ from openstack_dashboard import api
class AdminFloatingIpAllocate(forms.SelfHandlingForm):
pool = forms.ChoiceField(label=_("Pool"))
tenant = forms.ChoiceField(label=_("Project"))
pool = forms.ThemableChoiceField(label=_("Pool"))
tenant = forms.ThemableChoiceField(label=_("Project"))
floating_ip_address = forms.IPField(
label=_("Floating IP Address (optional)"),
required=False,

View File

@ -55,10 +55,11 @@ class UpdatePortInfoAction(workflows.Action):
vnic_type for vnic_type in api.neutron.VNIC_TYPES
if vnic_type[0] in supported_vnic_types
]
self.fields['binding__vnic_type'] = forms.ChoiceField(
choices=vnic_type_choices,
label=_("Binding: VNIC Type"),
required=False)
self.fields['binding__vnic_type'] = (
forms.ThemableChoiceField(
choices=vnic_type_choices,
label=_("Binding: VNIC Type"),
required=False))
except Exception:
msg = _("Unable to verify the VNIC types extension in Neutron")
exceptions.handle(self.request, msg)

View File

@ -42,8 +42,8 @@ class CreateForm(forms.SelfHandlingForm):
enable_snat = forms.BooleanField(label=_("Enable SNAT"),
initial=True,
required=False)
mode = forms.ChoiceField(label=_("Router Type"))
ha = forms.ChoiceField(label=_("High Availability Mode"))
mode = forms.ThemableChoiceField(label=_("Router Type"))
ha = forms.ThemableChoiceField(label=_("High Availability Mode"))
az_hints = forms.MultipleChoiceField(
label=_("Availability Zone Hints"),
required=False,