Skip to content

Commit 929ab72

Browse files
committed
Ignore abstract models during module validation
1 parent 624af02 commit 929ab72

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
1111
- cli: `update` and `uninstall` commands no longer require a valid config.
1212
- cli: Fixed a regression in `new` command leading to crash with `TypeError`.
1313
- config: Fixed `jobs` section deserialization.
14+
- database: Ignore abstract models during module validation.
1415

1516
## [6.4.0rc1] - 2022-12-09
1617

src/dipdup/utils/database.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ def iter_models(package: Optional[str]) -> Iterator[tuple[str, Type[TortoiseMode
114114

115115
attr_value = getattr(module, attr)
116116
if is_model_class(attr_value):
117+
if getattr(getattr(attr_value, 'Meta', None), 'abstract', False):
118+
continue
117119
yield app, attr_value
118120

119121

0 commit comments

Comments
 (0)