[vote] Support multiple delegations#3683
Open
vkrasnovyd wants to merge 8 commits into
Open
Conversation
vkrasnovyd
commented
Jul 21, 2026
| return result | ||
|
|
||
| def cleanup_delegations(self, delegatees_to_remove: list[int]) -> None: | ||
| """Remove delegations to ranked_others to ensure correct validation""" |
Contributor
Author
There was a problem hiding this comment.
Required so MeetingUserMixin has correct number of delegated votes for max_amount_error_user_ids checks.
vkrasnovyd
force-pushed
the
multi_delegation
branch
from
July 21, 2026 10:13
166aea0 to
727e4d8
Compare
vkrasnovyd
force-pushed
the
multi_delegation
branch
from
July 21, 2026 11:28
273f562 to
c3ff424
Compare
luisa-beerboom
requested changes
Jul 21, 2026
Co-authored-by: luisa-beerboom <101706784+luisa-beerboom@users.noreply.github.com>
luisa-beerboom
requested changes
Jul 22, 2026
| ) | ||
|
|
||
| if instance["vote_delegated_to_id"]: | ||
| vote_delegated_to_ids = instance["vote_delegated_to_ids"] |
Member
There was a problem hiding this comment.
If you do
Suggested change
| vote_delegated_to_ids = instance["vote_delegated_to_ids"] | |
| vote_delegated_to_ids: list[int] = instance["vote_delegated_to_ids"] |
and move it at the beginning of the method, you can also replace your instance.get("vote_delegated_to_ids", []) in the if condition.
Comment on lines
+474
to
+496
| def test_receive_delegations_from_2_users_1_request_ok(self) -> None: | ||
| self.set_models({"meeting_user/12": {"vote_delegated_to_ids": None}}) | ||
| response = self.request_multi( | ||
| "meeting_user.set_data", | ||
| [ | ||
| { | ||
| "id": 12, | ||
| "vote_delegations_from_ids": [13], | ||
| }, | ||
| { | ||
| "id": 12, | ||
| "vote_delegations_from_ids": [11], | ||
| }, | ||
| ], | ||
| ) | ||
| self.assert_status_code(response, 200) | ||
| self.assert_model_exists( | ||
| "meeting_user/12", {"vote_delegations_from_ids": [11, 13]} | ||
| ) | ||
| for id_ in [11, 13]: | ||
| self.assert_model_exists( | ||
| f"meeting_user/{id_}", {"vote_delegated_to_ids": [12]} | ||
| ) |
Member
There was a problem hiding this comment.
Maybe also a test for what happens the other way around?
Contributor
Author
There was a problem hiding this comment.
Added 2 for direct delegation: with redelegation and adding a new delegation.
luisa-beerboom
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adjusts backend to changes in meta: OpenSlides/openslides-meta#547
Original issue: OpenSlides/openslides-vote-service#553