Skip to content
Snippets Groups Projects
Commit 83cec5b9 authored by Neda Moeini's avatar Neda Moeini
Browse files

Improve range_field function in L2Circuits creation WF

parent 18b49060
No related branches found
No related tags found
1 merge request!307Feature/l2circuits
......@@ -48,7 +48,7 @@ def initial_input_generator(product_name: str) -> FormGenerator:
)
vlan_id: VLAN_ID
def vlan_range_field(*, is_tagged: bool) -> Any:
def _vlan_range_field(*, is_tagged: bool) -> VLAN_ID | ReadOnlyField:
"""Return the appropriate field type based on whether the circuit is tagged."""
return VLAN_ID if is_tagged else ReadOnlyField(None, default_type=int)
......@@ -56,10 +56,10 @@ def initial_input_generator(product_name: str) -> FormGenerator:
model_config = ConfigDict(title=f"{product_name} - Configure Edge Ports")
vlan_range_label: Label = Field("Please set a VLAN range, bounds including.", exclude=True)
vlan_range_lower_bound: vlan_range_field(
vlan_range_lower_bound: _vlan_range_field(
is_tagged=initial_user_input.layer_2_circuit_type == Layer2CircuitType.TAGGED
)
vlan_range_upper_bound: vlan_range_field(
vlan_range_upper_bound: _vlan_range_field(
is_tagged=initial_user_input.layer_2_circuit_type == Layer2CircuitType.TAGGED
)
vlan_divider: Divider = Field(None, exclude=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment