Skip to content

Commit a2ff31a

Browse files
committed
fix #131
1 parent ec48f79 commit a2ff31a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

django_typer/management/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,9 +1951,13 @@ def __new__(
19511951
attr_help = base.help
19521952

19531953
def command_bases() -> t.Generator[t.Type[TyperCommand], None, None]:
1954-
for base in reversed(bases):
1955-
if issubclass(base, TyperCommand) and base is not TyperCommand:
1956-
yield base
1954+
seen = set()
1955+
for first_level in reversed(bases):
1956+
for base in reversed(first_level.__mro__):
1957+
if issubclass(base, TyperCommand) and base is not TyperCommand:
1958+
if base not in seen:
1959+
seen.add(base)
1960+
yield base
19571961

19581962
typer_app = Typer(
19591963
name=name or attrs.get("__module__", "").rsplit(".", maxsplit=1)[-1],

0 commit comments

Comments
 (0)