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

Improve method check_delegator_restriction in delegation_based_restriction_mixin.py #2508

Closed
r-peschke opened this issue Jun 28, 2024 · 0 comments · Fixed by #2539
Closed
Assignees
Labels
enhancement General enhancement which is neither bug nor feature good first issue Good intro issue for introduction to the backend
Milestone

Comments

@r-peschke
Copy link
Member

First improvement:
Set the call parameter lock_result of the resulting db-calls to False. Reason: The result of the method are part of user permissions. It is not necessary to lock database in this cases.

Second improvement:
Reduce the database actions:

  1. Read the meeting_user instances:
    meeting_users = self.datastore.filter(
    "meeting_user",
    And(
    Or(
    FilterOperator("meeting_id", "=", meeting_id)
    for meeting_id in meeting_ids
    ),
    FilterOperator("user_id", "=", self.user_id),
    FilterOperator("vote_delegated_to_id", "!=", None),
    ),
    ["meeting_id"],
    )
  2. If there are meeting_users in the above result set, get their meeting_ids
  3. Read the meetings from point 2 with a get_many-db-call
  4. Get the broken_meetings the way the old implementation does without the meeting_user-related condition
@r-peschke r-peschke added high good first issue Good intro issue for introduction to the backend enhancement General enhancement which is neither bug nor feature labels Jun 28, 2024
@r-peschke r-peschke added this to the 4.2 milestone Jun 28, 2024
@rrenkert rrenkert removed the high label Jul 8, 2024
@luisa-beerboom luisa-beerboom self-assigned this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement which is neither bug nor feature good first issue Good intro issue for introduction to the backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants