From baacda2b8e29950741f57d19d9da86b3608b3119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Wed, 13 Mar 2019 10:58:01 +0100 Subject: [PATCH] Hotfix for #4501: Skipped many to many related objects autoupdate signal during migrations. --- openslides/core/signals.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openslides/core/signals.py b/openslides/core/signals.py index 84d2fa718..a469e0035 100644 --- a/openslides/core/signals.py +++ b/openslides/core/signals.py @@ -1,3 +1,5 @@ +import sys + from django.apps import apps from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType @@ -49,6 +51,11 @@ def autoupdate_for_many_to_many_relations(sender, instance, **kwargs): Send autoupdate for many-to-many related objects if the other side is deleted. """ + # Hotfix for #4501: Skip autoupdate for many-to-many related objects + # during migrations. + if "migrate" in sys.argv: + return + m2m_fields = ( field for field in instance._meta.get_fields(include_hidden=True)