Skip to content
Snippets Groups Projects
Verified Commit cb58294e authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Apply two suggestions

parent 1f5e2a0a
No related branches found
No related tags found
1 merge request!265Feature/refactor validators
Pipeline #88986 passed
...@@ -242,7 +242,9 @@ def get_active_site_subscriptions(includes: list[str] | None = None) -> list[Sub ...@@ -242,7 +242,9 @@ def get_active_site_subscriptions(includes: list[str] | None = None) -> list[Sub
:return: A list of Subscription objects for sites. :return: A list of Subscription objects for sites.
:rtype: list[Subscription] :rtype: list[Subscription]
""" """
return get_subscriptions(product_types=["Site"], lifecycles=[SubscriptionLifecycle.ACTIVE], includes=includes) # type: ignore[list-item] return get_subscriptions(
product_types=[ProductType.SITE], lifecycles=[SubscriptionLifecycle.ACTIVE], includes=includes
)
def get_site_by_name(site_name: str) -> Site: def get_site_by_name(site_name: str) -> Site:
......
...@@ -50,11 +50,10 @@ from gso.utils.workflow_steps import prompt_sharepoint_checklist_url ...@@ -50,11 +50,10 @@ from gso.utils.workflow_steps import prompt_sharepoint_checklist_url
def initial_input_form_generator(product_name: str) -> FormGenerator: def initial_input_form_generator(product_name: str) -> FormGenerator:
"""Gather input from the user in three steps. General information, and information on both sides of the trunk.""" """Gather input from the user in three steps. General information, and information on both sides of the trunk."""
# Add both provisioning and active routers, since trunks are required for promoting a router to active. # Add both provisioning and active routers, since trunks are required for promoting a router to active.
routers = { active_and_provisioning_routers = subscriptions.get_active_router_subscriptions(
str(router["subscription_id"]): router["description"] includes=["subscription_id", "description"]
for router in subscriptions.get_active_router_subscriptions(includes=["subscription_id", "description"]) ) + subscriptions.get_provisioning_router_subscriptions(includes=["subscription_id", "description"])
+ subscriptions.get_provisioning_router_subscriptions(includes=["subscription_id", "description"]) routers = {str(router["subscription_id"]): router["description"] for router in active_and_provisioning_routers}
}
class CreateIptrunkForm(FormPage): class CreateIptrunkForm(FormPage):
model_config = ConfigDict(title=product_name) model_config = ConfigDict(title=product_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment