-
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 (#1584)
* fix: Scoreboard issue with new levels * Improve test * Merge branch 'master' into fix_scoreboard_new_eps * Merge master * Merge branch 'master' into fix_scoreboard_new_eps * Merge branch 'master' into fix_scoreboard_new_eps
- Loading branch information
1 parent
0a47277
commit 8839c85
Showing
4 changed files
with
304 additions
and
82 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", "0088_rename_episodes")] | ||
operations = [ | ||
migrations.RunPython( | ||
mark_episodes_in_development, | ||
reverse_code=unmark_episodes_in_development, | ||
) | ||
] |
Oops, something went wrong.