Merge "Change the way of verifying field cidr"

changes/33/656433/7
Zuul 3 years ago committed by Gerrit Code Review
commit c6f19dc6d6
  1. 5
      openstack_dashboard/dashboards/project/networks/workflows.py

@ -139,6 +139,7 @@ class CreateSubnetInfoAction(workflows.Action):
required=False)
cidr = forms.IPField(label=_("Network Address"),
required=False,
initial="",
error_messages={
'required': _('Specify "Network Address" or '
@ -287,6 +288,10 @@ class CreateSubnetInfoAction(workflows.Action):
'"Enter Network Address manually" and specify '
'"Network Address".')
raise forms.ValidationError(msg)
if not cidr and address_source != 'subnetpool':
msg = _('Specify "Network Address" or '
'clear "Create Subnet" checkbox in previous step.')
raise forms.ValidationError(msg)
if address_source == 'subnetpool' and 'cidr' in self._errors:
del self._errors['cidr']
elif cidr:

Loading…
Cancel
Save