Skip to content

Commit

Permalink
Support proxy models with abstract or non-model bases in migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
SafaAlfulaij authored Aug 26, 2024
1 parent a68c69c commit e32c033
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pgtrigger/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ def _inject_m2m_dependency_in_proxy(proxy_op):
proxy models. Inject the dependency here
"""
for base in proxy_op.bases:
# Skip abstract models
if not (isinstance(base, str) and "." in base):
continue

model = apps.get_model(base)
creator = model._meta.auto_created
if creator:
Expand Down

0 comments on commit e32c033

Please sign in to comment.