Skip to content
Snippets Groups Projects
Commit b1c7f431 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Adapt event dependency migration to work with changed field lists of AKCategory and AKTrack

parent ae30cde9
No related branches found
No related tags found
No related merge requests found
Pipeline #23077 passed
This commit is part of merge request !107. Comments created here will be created in the context of that merge request.
......@@ -7,12 +7,12 @@ from AKModel.models import AKCategory, Event, AKTrack
def migrate_data_forward(apps, schema_editor):
for instance in AKCategory.objects.all():
for instance in AKCategory.objects.only('event').all():
if not instance.event:
instance.event = Event.objects.filter(active=True).last()
instance.save()
for instance in AKTrack.objects.all():
for instance in AKTrack.objects.only('event').all():
if not instance.event:
instance.event = Event.objects.filter(active=True).last()
instance.save()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment