Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid max_votes_per_option to be bigger than max_votes_amount #2765

Closed
Elblinator opened this issue Dec 11, 2024 · 1 comment · Fixed by #2772
Closed

Forbid max_votes_per_option to be bigger than max_votes_amount #2765

Elblinator opened this issue Dec 11, 2024 · 1 comment · Fixed by #2772
Assignees
Labels
Milestone

Comments

@Elblinator
Copy link
Member

Elblinator commented Dec 11, 2024

Describe the bug
It is currently possible to create an assignment poll where the max per option is bigger than the max per vote

How To Reproduce

  1. Activate assignment_poll_enable_max_votes_per_option
  2. Create an election poll with more votes per options than max (pollmethod.Y)

Payload from client (handle_request)

[
  {
    "action": "poll.create",
    "data": [
      {
        "meeting_id": 2,
        "title": "Ballot (2)",
        "onehundred_percent_base": "valid",
        "pollmethod": "Y",
        "type": "pseudoanonymous",
        "global_abstain": false,
        "global_no": false,
        "global_yes": false,
        "max_votes_amount": 1,
        "min_votes_amount": 1,
        "max_votes_per_option": 2,
        "options": [
          {
            "content_object_id": "user/1"
          }
        ],
        "content_object_id": "assignment/5",
        "entitled_group_ids": [
          7
        ],
        "backend": "fast"
      }
    ]
  }
]

Expected behavior
The backend should throw an Error if you try to create a poll with "max_votes_per_option" > "max_votes_amount"

@Elblinator
Copy link
Member Author

connected client Issue
OpenSlides/openslides-client#4453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants