-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update Python Den level 15 model solution
- Loading branch information
1 parent
2945f51
commit 88af21d
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
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,26 @@ | ||
from django.apps.registry import Apps | ||
from django.db import migrations | ||
|
||
|
||
def update_level_model_solution(apps: Apps, *args): | ||
Level = apps.get_model("game", "Level") | ||
level43 = Level.objects.get(name="1015", default=True) | ||
level43.model_solution = "[11,12]" | ||
level43.save() | ||
|
||
|
||
def revert_level_model_solution(apps: Apps, *args): | ||
Level = apps.get_model("game", "Level") | ||
level43 = Level.objects.get(name="1015", default=True) | ||
level43.model_solution = "[11]" | ||
level43.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [("game", "0102_reorder_episodes_13_14")] | ||
operations = [ | ||
migrations.RunPython( | ||
update_level_model_solution, | ||
reverse_code=revert_level_model_solution, | ||
) | ||
] |