From 88af21d80be6a25c85949f03e147836987b84c9e Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Mon, 30 Sep 2024 13:53:52 +0100 Subject: [PATCH] fix: Update Python Den level 15 model solution --- ...3_14.py => 0102_reorder_episodes_13_14.py} | 0 game/migrations/0103_level_1015_solution.py | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+) rename game/migrations/{0102_reoder_episodes_13_14.py => 0102_reorder_episodes_13_14.py} (100%) create mode 100644 game/migrations/0103_level_1015_solution.py diff --git a/game/migrations/0102_reoder_episodes_13_14.py b/game/migrations/0102_reorder_episodes_13_14.py similarity index 100% rename from game/migrations/0102_reoder_episodes_13_14.py rename to game/migrations/0102_reorder_episodes_13_14.py diff --git a/game/migrations/0103_level_1015_solution.py b/game/migrations/0103_level_1015_solution.py new file mode 100644 index 000000000..c11d45525 --- /dev/null +++ b/game/migrations/0103_level_1015_solution.py @@ -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, + ) + ]