From 83cec5b979a5744ad6bfd3ec801c4118874c47f2 Mon Sep 17 00:00:00 2001 From: Neda Moeini <neda.moeini@geant.org> Date: Mon, 4 Nov 2024 11:29:15 +0100 Subject: [PATCH] Improve range_field function in L2Circuits creation WF --- gso/workflows/l2_circuit/create_layer_2_circuit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gso/workflows/l2_circuit/create_layer_2_circuit.py b/gso/workflows/l2_circuit/create_layer_2_circuit.py index 65eca999..59f5983d 100644 --- a/gso/workflows/l2_circuit/create_layer_2_circuit.py +++ b/gso/workflows/l2_circuit/create_layer_2_circuit.py @@ -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) -- GitLab