Skip to content

Commit

Permalink
fix staticmethod name bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Jan 7, 2025
1 parent 7b41c78 commit 2a0d638
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ jobs:
just init
just install
just pin-dependency Django~=${{ matrix.django-version }}
- name: Install Fish shell
run: |
sudo apt-get update
sudo apt-get install -y fish
# - name: Install Fish shell
# run: |
# sudo apt-get update
# sudo apt-get install -y fish
- name: Install Emacs
if: ${{ github.event.inputs.debug == 'true' }}
run: |
Expand Down
8 changes: 5 additions & 3 deletions django_typer/management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ def create_app(
func: t.Callable[Concatenate[TC, P2], R2],
) -> Typer[P2, R2]:
grp: Typer[P2, R2] = Typer( # pyright: ignore[reportAssignmentType]
name=name or func.__name__.replace("_", "-"),
name=name or _strip_static(func).__name__.replace("_", "-"),
cls=type("_DTGroup", (cls,), {"django_command": self.django_command}),
invoke_without_command=invoke_without_command,
no_args_is_help=no_args_is_help,
Expand All @@ -1358,7 +1358,9 @@ def create_app(
parent=self,
**kwargs,
)
self.add_typer(grp, name=name or func.__name__.replace("_", "-"))
self.add_typer(
grp, name=name or _strip_static(func).__name__.replace("_", "-")
)
return grp

return create_app
Expand Down Expand Up @@ -1794,7 +1796,7 @@ def create_app(
func: t.Callable[Concatenate[TC, P], R],
) -> Typer[P, R]:
grp = Typer(
name=name or func.__name__.replace("_", "-"),
name=name or _strip_static(func).__name__.replace("_", "-"),
cls=cls,
invoke_without_command=invoke_without_command,
no_args_is_help=no_args_is_help,
Expand Down

0 comments on commit 2a0d638

Please sign in to comment.