From e32c03367204859b4978f53bca03b3aa187ebedb Mon Sep 17 00:00:00 2001 From: Safa Alfulaij Date: Mon, 26 Aug 2024 16:22:04 +0300 Subject: [PATCH] Support proxy models with abstract or non-model bases in migrations --- pgtrigger/migrations.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pgtrigger/migrations.py b/pgtrigger/migrations.py index d8dc708..8b7a103 100644 --- a/pgtrigger/migrations.py +++ b/pgtrigger/migrations.py @@ -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: