Skip to content

Commit

Permalink
Special-case templates named "app" in `TemplateName.is_singular_insta…
Browse files Browse the repository at this point in the history
…nce`
  • Loading branch information
doshitan committed Dec 24, 2024
1 parent 2666a12 commit c965496
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions nava/platform/templates/template_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@ def answers_file_prefix(self) -> str:
def is_singular_instance(self, app_name: str) -> bool:
"""Check if this app_name implies the template only exists once for project.
Effectively, when the app name is the same name as the template itself,
assume the template is something which only has one instance in a given
project.
Effectively, when the app name is the same name as the template itself
(barring some special cases), assume the template is something which
only has one instance in a given project.
"""
# special case templates with the name "app", which by convention
# shouldn't be unique and if someone wants to install an instance of the
# template as "app" instead of "example-app"/a name that corresponds to
# its purpose, well...let them
if self.template_name == "app":
return False

return app_name == self.template_name

0 comments on commit c965496

Please sign in to comment.