From 76b01c13de5bb6263fa52eb954c02d43cc467815 Mon Sep 17 00:00:00 2001 From: M1ha Date: Wed, 19 Dec 2018 13:15:42 +0500 Subject: [PATCH] Fix multiple model registration --- src/django_clickhouse/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/django_clickhouse/models.py b/src/django_clickhouse/models.py index 1c78f86..698eda2 100644 --- a/src/django_clickhouse/models.py +++ b/src/django_clickhouse/models.py @@ -175,7 +175,8 @@ class ClickHouseSyncModel(DjangoModel): def _on_commit(): for model_cls in cls.get_clickhouse_sync_models(): - storage.register_operations_wrapped(model_cls.get_import_key(), operation, *model_pks) + if model_cls.django_model == cls: + storage.register_operations_wrapped(model_cls.get_import_key(), operation, *model_pks) if len(model_pks) > 0: storage = cls.get_clickhouse_storage()