Skip to content

[vote] Update meeting defaults for polls#3644

Merged
vkrasnovyd merged 10 commits into
OpenSlides:feature/votefrom
vkrasnovyd:feature/vote
Jul 7, 2026
Merged

[vote] Update meeting defaults for polls#3644
vkrasnovyd merged 10 commits into
OpenSlides:feature/votefrom
vkrasnovyd:feature/vote

Conversation

@vkrasnovyd

@vkrasnovyd vkrasnovyd commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Adjusts backend to the changes in OpenSlides/openslides-meta#532

How the poll_default settings fields of the meeting will be migrated is described here: https://github.com/OpenSlides/openslides-vote-service/tree/feature/vote/Migration.md#meeting

@vkrasnovyd vkrasnovyd self-assigned this Jun 29, 2026
@vkrasnovyd vkrasnovyd marked this pull request as draft June 29, 2026 16:35
@vkrasnovyd vkrasnovyd force-pushed the feature/vote branch 2 times, most recently from 6a4dca2 to 3ee862c Compare July 3, 2026 17:25
@vkrasnovyd vkrasnovyd marked this pull request as ready for review July 6, 2026 14:31
@vkrasnovyd vkrasnovyd requested a review from luisa-beerboom July 6, 2026 14:31

@luisa-beerboom luisa-beerboom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk what I think about this new collection, however the code looks mostly good to me.


# Set poll defaults
poll_default_field_name_pattern = re.compile(
r"([a-z]+)_poll_default_([a-z_]+[a-z]+)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think

Suggested change
r"([a-z]+)_poll_default_([a-z_]+[a-z]+)"
r"([a-z]+)_poll_default_(([a-z]+_)*[a-z]+)"

might be more accurate to the pattern you're trying to match, though I wonder if a regex isn't a bit overkill for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I've just realized that .split() would do the same job in this case.

Comment on lines +45 to +48
poll_type_field_name, poll_type_field_value = next(
iter(poll_types_fields.items())
)
self.check_equal_fields(instance, poll_type_field_name, poll_type_field_value)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setup of grabbing the next value in a dict iteration and checking only that seems somewhat incomplete unless one knows that there can be only one of the POLL_TYPE_FIELDS in the instance.
I'd suggest either using a for loop or writing an explanatory comment.

@vkrasnovyd vkrasnovyd Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check above raises error if number of items in poll_types_fields is not 1. Descriptions of the helper methods were not really descriptive indeed. Added proper docstrings.

@bastianjoel bastianjoel assigned bastianjoel and unassigned vkrasnovyd Jul 7, 2026
@vkrasnovyd vkrasnovyd merged commit 9c0082d into OpenSlides:feature/vote Jul 7, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants