diff --git a/reflex/constants/base.py b/reflex/constants/base.py index 7d51b757b..b50ce50ac 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -101,7 +101,7 @@ class Templates(SimpleNamespace): AI = "ai" # The option for the user to choose a remote template. - CHOOSE_TEMPLATES = "choose templates" + CHOOSE_TEMPLATES = "choose-templates" # The reflex.build frontend host REFLEX_BUILD_FRONTEND = "https://flexgen.reflex.run" diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index d86619a78..8c7923116 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -1223,7 +1223,9 @@ def prompt_for_template_options(templates: list[Template]) -> str: # Prompt the user to select a template. id_to_name = { - str(idx): f"{template.name} ({template.demo_url}) - {template.description}" + str( + idx + ): f"{template.name.replace('_', ' ').replace('-', ' ')} ({template.demo_url}) - {template.description}" for idx, template in enumerate(templates) } for id in range(len(id_to_name)): @@ -1489,8 +1491,8 @@ def fetch_and_prompt_with_remote_templates( if not show_prompt and template in available_templates: return template, available_templates - if not show_prompt and (template not in templates): - console.error(f"{template} is not a valid template name.") + if not show_prompt and (template not in available_templates): + console.error(f"{template!r} is not a valid template name.") template = ( prompt_for_remote_template_selection(available_templates)