From 3eb5273b8e4714c8157fded8b665b6e420d2dc8b Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Tue, 16 Apr 2019 15:45:59 +0200 Subject: [PATCH] send autoupdate on state update for motions --- openslides/motions/views.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openslides/motions/views.py b/openslides/motions/views.py index 31d3acd91..f9713f34e 100644 --- a/openslides/motions/views.py +++ b/openslides/motions/views.py @@ -1425,3 +1425,14 @@ class StateViewSet( msg = self.getProtectedErrorMessage("workflow", err) raise ValidationError({"detail": msg}) return result + + def update(self, *args, **kwargs): + """ + Sends autoupdate for all motions that are affected by the state change. + Maybe the restriction was changed, so the view permission for some + motions could have been changed. + """ + result = super().update(*args, **kwargs) + state = self.get_object() + inform_changed_data(Motion.objects.filter(state=state)) + return result