Skip to content

Commit

Permalink
Fix startunicorn error. #142
Browse files Browse the repository at this point in the history
  • Loading branch information
adamghill committed Feb 1, 2021
1 parent e0aa01b commit b7e1702
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions django_unicorn/management/commands/startunicorn.py
Expand Up @@ -2,13 +2,13 @@

from django.core.management.base import BaseCommand, CommandError

from ...components import convert_to_camel_case, convert_to_snake_case
from ...components import convert_to_pascal_case, convert_to_snake_case


COMPONENT_FILE = """from django_unicorn.components import UnicornView
class {camel_case_component_name}View(UnicornView):
class {pascal_case_component_name}View(UnicornView):
pass
"""

Expand All @@ -34,7 +34,7 @@ def handle(self, *args, **options):

for component_name in options["component_names"]:
snake_case_component_name = convert_to_snake_case(component_name)
camel_case_component_name = convert_to_camel_case(component_name)
pascal_case_component_name = convert_to_pascal_case(component_name)

# Create component
if not Path("unicorn/components").exists():
Expand All @@ -43,7 +43,7 @@ def handle(self, *args, **options):
component_path = Path(f"unicorn/components/{snake_case_component_name}.py")
component_path.write_text(
COMPONENT_FILE.format(
**{"camel_case_component_name": camel_case_component_name}
**{"pascal_case_component_name": pascal_case_component_name}
)
)
self.stdout.write(self.style.SUCCESS(f"Created {component_path}."))
Expand Down

0 comments on commit b7e1702

Please sign in to comment.