Skip to content

Commit 377dbaf

Browse files
committed
Change stored dump path
1 parent 3fe6f61 commit 377dbaf

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

core/management/commands/migrate_education.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def migrate_organization_to_education() -> int:
3535
"""
3636
Migrate old field `organization` to new model `Education`.
3737
Returns count migrated users.
38-
Stored migrated info into `BASE_DIR / "core" / "log" / "migrated_users.json"`
38+
Stored migrated info into `BASE_DIR / "log" / "migrated_users.json"`
3939
"""
4040
user_with_education_ids: list[int] = UserEducation.objects.values_list("user__id", flat=True)
4141
users_with_organization_without_education = (
@@ -57,7 +57,7 @@ def migrate_organization_to_education() -> int:
5757
for user in users_with_organization_without_education
5858
]
5959

60-
file_dump = settings.BASE_DIR / "core" / "log" / "migrated_users.json"
60+
file_dump = settings.BASE_DIR / "log" / "migrated_users.json"
6161
with open(file_dump, "w", encoding="utf-8") as file:
6262
json.dump(data, file, indent=4, ensure_ascii=False)
6363

log/migrated_users.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"user_id": 3,
4+
"user_organization_field": "Учеба 1"
5+
},
6+
{
7+
"user_id": 4,
8+
"user_organization_field": "Учеба 2"
9+
},
10+
{
11+
"user_id": 5,
12+
"user_organization_field": "Учеба 3"
13+
}
14+
]

0 commit comments

Comments
 (0)