From 6d626147d02c79f10f3c0343c50fa0392e409505 Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <ak@geant.org>
Date: Tue, 26 Nov 2024 16:57:10 +0000
Subject: [PATCH] IPv6BGPPeer: make IPType filed invisible in GUI.

---
 .../nren_l3_core_service/create_nren_l3_core_service.py     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gso/workflows/nren_l3_core_service/create_nren_l3_core_service.py b/gso/workflows/nren_l3_core_service/create_nren_l3_core_service.py
index d8e537bd..9fb5d7c7 100644
--- a/gso/workflows/nren_l3_core_service/create_nren_l3_core_service.py
+++ b/gso/workflows/nren_l3_core_service/create_nren_l3_core_service.py
@@ -82,7 +82,6 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
             return IPTypes.IPV4
 
     class IPv6BGPPeer(BaseModel):
-        ip_type: IPTypes = IPTypes.IPV6
         peer_address: IPv6AddressType
         authentication_key: str | None = None
         has_custom_policies: bool = False
@@ -97,6 +96,11 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
         def families(self) -> list[IPFamily]:
             return [IPFamily.V6UNICAST, IPFamily.V6MULTICAST] if self.add_v6_multicast else [IPFamily.V6UNICAST]
 
+        @computed_field  # type: ignore[misc]
+        @property
+        def ip_type(self) -> IPTypes:
+            return IPTypes.IPV6
+
     class BindingPortInputForm(FormPage):
         model_config = ConfigDict(title=f"{product_name} - Configure Edge Port")
         info_label: Label = Field("Please configure the Service Binding Ports for the Edge Port.", exclude=True)
-- 
GitLab