diff --git a/openslides/poll/views.py b/openslides/poll/views.py index 1ca2c6c1d..fabb87f9a 100644 --- a/openslides/poll/views.py +++ b/openslides/poll/views.py @@ -156,6 +156,7 @@ class BasePollViewSet(ModelViewSet): poll.state = BasePoll.STATE_PUBLISHED poll.save() + inform_changed_data(vote.user for vote in poll.get_votes().all() if vote.user) inform_changed_data(poll.get_votes()) inform_changed_data(poll.get_options()) return Response() diff --git a/tests/integration/assignments/test_polls.py b/tests/integration/assignments/test_polls.py index 78f944cba..6d0575a06 100644 --- a/tests/integration/assignments/test_polls.py +++ b/tests/integration/assignments/test_polls.py @@ -1979,52 +1979,57 @@ class VoteAssignmentPollNamedAutoupdates(VoteAssignmentPollAutoupdatesBaseClass) self.assertAutoupdate(poll, user=user) autoupdate = self.get_last_autoupdate(user=user) self.assertEqual( - autoupdate[0], + autoupdate[0]["assignments/assignment-poll:1"], { - "assignments/assignment-poll:1": { - "allow_multiple_votes_per_candidate": False, - "amount_global_abstain": None, - "amount_global_no": None, - "assignment_id": 1, - "description": "test_description_paiquei5ahpie1wu8ohW", - "global_abstain": True, - "global_no": True, - "groups_id": [GROUP_DELEGATE_PK], - "id": 1, - "majority_method": "two_thirds", - "onehundred_percent_base": "cast", - "options_id": [1], - "pollmethod": "YNA", - "state": 4, - "title": self.poll.title, - "type": "named", - "votes_amount": 1, - "votescast": "1.000000", - "votesinvalid": "0.000000", - "votesvalid": "1.000000", - "user_has_voted": user == self.user, - "voted_id": [self.user.id], - }, - "assignments/assignment-vote:1": { - "pollstate": AssignmentPoll.STATE_PUBLISHED, - "id": 1, - "weight": "1.000000", - "value": "A", - "user_id": 3, - "option_id": 1, - }, - "assignments/assignment-option:1": { - "abstain": "1.000000", - "id": 1, - "no": "0.000000", - "poll_id": 1, - "pollstate": AssignmentPoll.STATE_PUBLISHED, - "yes": "0.000000", - "user_id": 1, - "weight": 1, - }, + "allow_multiple_votes_per_candidate": False, + "amount_global_abstain": None, + "amount_global_no": None, + "assignment_id": 1, + "description": "test_description_paiquei5ahpie1wu8ohW", + "global_abstain": True, + "global_no": True, + "groups_id": [GROUP_DELEGATE_PK], + "id": 1, + "majority_method": "two_thirds", + "onehundred_percent_base": "cast", + "options_id": [1], + "pollmethod": "YNA", + "state": 4, + "title": self.poll.title, + "type": "named", + "votes_amount": 1, + "votescast": "1.000000", + "votesinvalid": "0.000000", + "votesvalid": "1.000000", + "user_has_voted": user == self.user, + "voted_id": [self.user.id], }, ) + self.assertEqual( + autoupdate[0]["assignments/assignment-vote:1"], + { + "pollstate": AssignmentPoll.STATE_PUBLISHED, + "id": 1, + "weight": "1.000000", + "value": "A", + "user_id": 3, + "option_id": 1, + }, + ) + self.assertEqual( + autoupdate[0]["assignments/assignment-option:1"], + { + "abstain": "1.000000", + "id": 1, + "no": "0.000000", + "poll_id": 1, + "pollstate": AssignmentPoll.STATE_PUBLISHED, + "yes": "0.000000", + "user_id": 1, + "weight": 1, + }, + ) + self.assertIn("users/user:3", autoupdate[0]) class VoteAssignmentPollPseudoanonymousAutoupdates(