From 66e850127c19f0bec327dd9c5fea82356c175a11 Mon Sep 17 00:00:00 2001 From: Toksi86 Date: Thu, 10 Oct 2024 21:48:53 +0500 Subject: [PATCH 1/2] The default value of the team supervisor is set to None --- adaptive_hockey_federation/core/management/commands/fill-db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adaptive_hockey_federation/core/management/commands/fill-db.py b/adaptive_hockey_federation/core/management/commands/fill-db.py index db2578b2..46301285 100644 --- a/adaptive_hockey_federation/core/management/commands/fill-db.py +++ b/adaptive_hockey_federation/core/management/commands/fill-db.py @@ -56,7 +56,7 @@ def load_real_data(self) -> None: # noqa: C901 "name": item["name"], "city_id": item["city_id"], "discipline_name_id": item["discipline_name_id"], - "curator_id": 1, + "curator_id": None, } instance = model(**team_data) elif table_name == "main_player": From b8f97158977698831b6d8abb351c9ce45f0d2471 Mon Sep 17 00:00:00 2001 From: Konstantin Raikhert Date: Fri, 11 Oct 2024 10:23:11 +0300 Subject: [PATCH 2/2] delete artefact --- .../core/fixtures/fill_random_diagnosis.py | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 adaptive_hockey_federation/core/fixtures/fill_random_diagnosis.py diff --git a/adaptive_hockey_federation/core/fixtures/fill_random_diagnosis.py b/adaptive_hockey_federation/core/fixtures/fill_random_diagnosis.py deleted file mode 100644 index ebf64021..00000000 --- a/adaptive_hockey_federation/core/fixtures/fill_random_diagnosis.py +++ /dev/null @@ -1,24 +0,0 @@ -import json -import random - - -# TODO: (Скрипт который заполняет диагнозы игроков, -# но его можно убрать, как будут реальные данные -# по диагнозам игроков.) - - -with open("main_player.json", "r", encoding="utf-8") as f: - players = json.load(f) - -with open("main_diagnosis.json", "r", encoding="utf-8") as f: - diagnoses = json.load(f) - -diagnosis_ids = [diagnosis["id"] for diagnosis in diagnoses] - -for player in players: - player["diagnosis_id"] = random.choice(diagnosis_ids) - -with open("main_player.json", "w", encoding="utf-8") as f: - json.dump(players, f, ensure_ascii=False, indent=4) - -print("Диагнозы успешно назначены и сохранены в main_player_updated.json")