Merge pull request #2393 from normanjaeckel/FixAutoupdateConnction

Reconnect autoupdate after some migrations. Fixed #2377.
This commit is contained in:
Emanuel Schütze 2016-09-17 13:42:51 +02:00 committed by GitHub
commit 4b0594a83b
2 changed files with 14 additions and 0 deletions

View File

@ -5,6 +5,8 @@ from __future__ import unicode_literals
import django.db.models.deletion import django.db.models.deletion
from django.db import migrations, models from django.db import migrations, models
from openslides.utils.autoupdate import inform_changed_data_receiver
def change_label_of_state(apps, schema_editor): def change_label_of_state(apps, schema_editor):
""" """
@ -27,6 +29,11 @@ def change_label_of_state(apps, schema_editor):
state.action_word = 'Refer to committee' state.action_word = 'Refer to committee'
state.save() state.save()
# Reconnect autoupdate.
models.signals.post_save.connect(
inform_changed_data_receiver,
dispatch_uid='inform_changed_data_receiver')
def add_recommendation_labels(apps, schema_editor): def add_recommendation_labels(apps, schema_editor):
""" """

View File

@ -4,6 +4,8 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from openslides.utils.autoupdate import inform_changed_data_receiver
def migrate_groups_and_user_permissions(apps, schema_editor): def migrate_groups_and_user_permissions(apps, schema_editor):
""" """
@ -50,6 +52,11 @@ def migrate_groups_and_user_permissions(apps, schema_editor):
for permission in group_registered.permissions.all(): for permission in group_registered.permissions.all():
group.permissions.add(permission) group.permissions.add(permission)
# Reconnect autoupdate.
models.signals.post_save.connect(
inform_changed_data_receiver,
dispatch_uid='inform_changed_data_receiver')
class Migration(migrations.Migration): class Migration(migrations.Migration):