File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
backend/siarnaq/api/compete Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,20 @@ def to_representation(self, instance):
271271 if self .context ["user_is_staff" ]:
272272 # Staff can see everything
273273 pass
274+ elif (
275+ (
276+ instance .tournament_round is not None
277+ and instance .tournament_round .release_status <= ReleaseStatus .HIDDEN
278+ )
279+ or (
280+ instance .tournament_round is not None
281+ and not instance .tournament_round .tournament .is_public
282+ )
283+ or instance .participants .filter (team__status = TeamStatus .INVISIBLE ).exists ()
284+ ):
285+ # Fully redact matches from private tournaments, unreleased tournament
286+ # rounds, and those with invisible teams.
287+ data ["participants" ] = data ["replay_url" ] = data ["maps" ] = None
274288 elif (
275289 instance .tournament_round is not None
276290 and instance .tournament_round .release_status <= ReleaseStatus .PARTICIPANTS
You can’t perform that action at this time.
0 commit comments