Skip to content

Commit 87d76fa

Browse files
🗃️ [#4486] Prepare submissions for migration squashing
1 parent f713cdb commit 87d76fa

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
# Generated by Django 3.2.21 on 2023-11-17 10:40
22

33
from django.db import migrations
4-
from django.db.migrations.state import StateApps
5-
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
6-
7-
from furl import furl
8-
9-
10-
def cleanup_submission_urls(
11-
apps: StateApps, schema_editor: BaseDatabaseSchemaEditor
12-
) -> None:
13-
14-
Submission = apps.get_model("submissions", "Submission")
15-
16-
for submission in Submission.objects.iterator():
17-
f = furl(submission.form_url)
18-
f.remove(fragment=True)
19-
if f.path.segments[-1:] == ["startpagina"]:
20-
f.path.segments.remove("startpagina")
21-
submission.form_url = f.url
22-
23-
submission.save()
244

255

266
class Migration(migrations.Migration):
@@ -29,6 +9,6 @@ class Migration(migrations.Migration):
299
("submissions", "0002_change_json_encoder"),
3010
]
3111

32-
operations = [
33-
migrations.RunPython(cleanup_submission_urls, migrations.RunPython.noop)
34-
]
12+
# RunPython operation removed as part of 2.7 release cycle, which requires 2.6.7 to
13+
# be run first.
14+
operations = []

0 commit comments

Comments
 (0)