Allow template with unspecified demo_url (#4741)

This commit is contained in:
Masen Furer 2025-02-03 16:28:36 -08:00 committed by GitHub
parent 44d6e1124c
commit 2ff840aba6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,7 @@ class Template:
name: str
description: str
code_url: str
demo_url: str
demo_url: str | None = None
@dataclasses.dataclass(frozen=True)
@ -1461,7 +1461,7 @@ def prompt_for_template_options(templates: list[Template]) -> str:
# Show the user the URLs of each template to preview.
console.print("\nGet started with a template:")
def format_demo_url_str(url: str) -> str:
def format_demo_url_str(url: str | None) -> str:
return f" ({url})" if url else ""
# Prompt the user to select a template.