Skip to content

Commit

Permalink
allow manual autoscrims when episode frozen (#930)
Browse files Browse the repository at this point in the history
:shipit:
  • Loading branch information
lowtorola authored Jan 25, 2025
1 parent a72804d commit 8a3b24c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/siarnaq/api/episodes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def autoscrim(modeladmin, request, queryset):
logger.info("autoscrim", message="Forcibly enqueueing autoscrims.")
# For now, autoscrims are always best of 3.
for episode in queryset:
episode.autoscrim(best_of=3)
episode.autoscrim(best_of=3, override_freeze=True)


@admin.action(description="Export all submitted resumes")
Expand Down
4 changes: 2 additions & 2 deletions backend/siarnaq/api/episodes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def frozen(self):
is_public=True,
).exists()

def autoscrim(self, best_of):
def autoscrim(self, best_of, override_freeze=False):
"""
Trigger a round of automatically-generated ranked scrimmages for all teams in
this episode with an accepted submission, unless the episode is archived or
Expand All @@ -149,7 +149,7 @@ def autoscrim(self, best_of):
number of maps available for the episode.
"""
log = logger.bind(episode=self.pk)
if self.frozen():
if self.frozen() and not override_freeze:
log.warn("autoscrim_frozen", message="Refusing to autoscrim: frozen.")
return
if timezone.now() > self.game_archive:
Expand Down

0 comments on commit 8a3b24c

Please sign in to comment.