gathering / unicorn-backend

Backend/API for UNICORN
https://competitions.gathering.org
MIT License
2 stars 1 forks source link

Refactor voting entry permissions away from management command #26

Closed eriktm closed 1 year ago

eriktm commented 2 years ago

Proposed Changes

In competitions/management/commands/update_competition_states.py there is a function Command.set_permissions which contains the logic of giving participants permission to view all qualified entries during the timespan of which voting is enabled on the relevant Competition. This logic should be moved closer to the objects.

Justification

With the current logic, permissions are not given when, say, the vote end time of a Competition is extended after voting is completed.