Skip to content

Commit 8a3b24c

Browse files
authored
allow manual autoscrims when episode frozen (#930)
:shipit:
1 parent a72804d commit 8a3b24c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backend/siarnaq/api/episodes/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def autoscrim(modeladmin, request, queryset):
2121
logger.info("autoscrim", message="Forcibly enqueueing autoscrims.")
2222
# For now, autoscrims are always best of 3.
2323
for episode in queryset:
24-
episode.autoscrim(best_of=3)
24+
episode.autoscrim(best_of=3, override_freeze=True)
2525

2626

2727
@admin.action(description="Export all submitted resumes")

backend/siarnaq/api/episodes/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def frozen(self):
136136
is_public=True,
137137
).exists()
138138

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

0 commit comments

Comments
 (0)