-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Scoreboard issue with new levels
- Loading branch information
1 parent
250a9c1
commit 9aed69f
Showing
3 changed files
with
136 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.apps.registry import Apps | ||
from django.db import migrations | ||
|
||
|
||
def mark_episodes_in_development(apps: Apps, *args): | ||
Episode = apps.get_model("game", "Episode") | ||
|
||
for i in range(13, 16): | ||
episode = Episode.objects.get(pk=i) | ||
episode.in_development = True | ||
episode.save() | ||
|
||
|
||
def unmark_episodes_in_development(apps: Apps, *args): | ||
Episode = apps.get_model("game", "Episode") | ||
|
||
for i in range(13, 16): | ||
episode = Episode.objects.get(pk=i) | ||
episode.in_development = False | ||
episode.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [("game", "0087_workspace_python_view_enabled")] | ||
operations = [ | ||
migrations.RunPython( | ||
mark_episodes_in_development, | ||
reverse_code=unmark_episodes_in_development, | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters