Skip to content
Snippets Groups Projects

Improvements from NAT-408 and NAT-412.

12 files
+ 40
43
Compare changes
  • Side-by-side
  • Inline
Files
12
+ 0
11
@@ -6,8 +6,6 @@ For the time being, it's hardcoded to only contain GÉANT as a customer, since t
@@ -6,8 +6,6 @@ For the time being, it's hardcoded to only contain GÉANT as a customer, since t
from typing import Any
from typing import Any
from pydantic_forms.validators import Choice
class CustomerNotFoundError(Exception):
class CustomerNotFoundError(Exception):
"""Exception raised when a customer is not found."""
"""Exception raised when a customer is not found."""
@@ -31,12 +29,3 @@ def get_customer_by_name(name: str) -> dict[str, Any]:
@@ -31,12 +29,3 @@ def get_customer_by_name(name: str) -> dict[str, Any]:
msg = f"Customer {name} not found"
msg = f"Customer {name} not found"
raise CustomerNotFoundError(msg)
raise CustomerNotFoundError(msg)
def customer_selector() -> Choice:
"""GUI input field for selecting a customer."""
customers = {}
for customer in all_customers():
customers[customer["id"]] = customer["name"]
return Choice("Select a customer", zip(customers.keys(), customers.items(), strict=True)) # type: ignore[arg-type]
Loading