Skip to content

Commit

Permalink
fix: KeyError raised when removing or renaming an existing model
Browse files Browse the repository at this point in the history
  • Loading branch information
waketzheng committed Dec 12, 2024
1 parent 6270c47 commit 56da0e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### [0.8.1](Unreleased)

#### Fixed
- fix: error when there is __init__.py in the migration folder (#272)
- fix: error when there is `__init__.py` in the migration folder (#272)
- Setting null=false on m2m field causes migration to fail. (#334)
- Fix NonExistentKey when running `aerich init` without `[tool]` section in config file. (#284)
- Fix configuration file reading error when containing Chinese characters. (#286)
Expand Down
2 changes: 1 addition & 1 deletion aerich/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def is_version_file(file_name: str) -> bool:

@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]:
Expand Down

0 comments on commit 56da0e7

Please sign in to comment.