fix: KeyError raised when removing or renaming an existing model

This commit is contained in:
Waket Zheng
2024-12-12 10:43:40 +08:00
parent 6270c4781e
commit 56da0e7e3c
2 changed files with 2 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ class Migrate:
@classmethod
def _get_model(cls, model: str) -> Type[Model]:
return Tortoise.apps[cls.app][model]
return Tortoise.apps[cls.app].get(model) # type: ignore
@classmethod
async def get_last_version(cls) -> Optional[Aerich]: