Restrict clarifications to teams in the contest #3114
Merged
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.
This is helpful for when:
You have a shared DOMjudge instance with 2 different contests
The contests are not open to all teams but limited by categories (or directly assigned).
When you're a jury member in one of the contests you would still see all teams (union of both contests) in the
send clarification
page.I do wonder if this is duplicated somewhere, and if we shouldn't let a dedicated Service handle the teams. The other reasonable place is the Contest itself but as that's an Entity it doesn't have an easy way of exposing which teams are in the contest when the contest is open to all teams (as you would need to query the database).
If there would be a TeamService we can change all queries to there and make sure we always get the consistent set without having to do this logic everywhere. For example I first tried this with the
Contest->getTeams()
which would return nothing in normal cases (but I would say is reasonable without this background knowledge).