Set "remove rule" field to be required in dialog

The dialog can be open from: the "Firewalls"->"Firewall Policies"
->"More" button of a policy->"Remove Rule"

The "remove rule" field should be required, otherwise, user will
hit error when no rule is select. Removed "required=False",
because it is default to True.

Added 'btn-danger' to the button style

Change-Id: Ifa21419bc93818335057bb16ed2683994c6efee7
Closes-Bug: #1252996
This commit is contained in:
chenhaiq 2013-12-06 18:32:07 +08:00
parent 7ed7b730e8
commit 6557ff66d7
2 changed files with 2 additions and 3 deletions

View File

@ -258,8 +258,7 @@ class InsertRuleToPolicy(forms.SelfHandlingForm):
class RemoveRuleFromPolicy(forms.SelfHandlingForm):
firewall_rule_id = forms.ChoiceField(label=_("Remove Rule"),
required=False)
firewall_rule_id = forms.ChoiceField(label=_("Remove Rule"))
failure_url = 'horizon:project:firewalls:index'

View File

@ -114,7 +114,7 @@ class InsertRuleToPolicyLink(tables.LinkAction):
class RemoveRuleFromPolicyLink(tables.LinkAction):
name = "removerule"
verbose_name = _("Remove Rule")
classes = ("ajax-modal", "btn-update",)
classes = ("ajax-modal", "btn-danger",)
def get_link_url(self, policy):
base_url = reverse("horizon:project:firewalls:removerule",