From 550eff83ee67a84a4b7da23dc9fc67675cf91ac6 Mon Sep 17 00:00:00 2001 From: Arona Jones Date: Fri, 19 May 2023 11:25:18 +0000 Subject: [PATCH] Update 0046_create_powertests.py Fine, I'll do it that way. --- RIGS/migrations/0046_create_powertests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/migrations/0046_create_powertests.py b/RIGS/migrations/0046_create_powertests.py index d8b8b233..b9472f55 100644 --- a/RIGS/migrations/0046_create_powertests.py +++ b/RIGS/migrations/0046_create_powertests.py @@ -10,7 +10,7 @@ def migrate_old_data(apps, schema_editor): PowerTestRecord = apps.get_model('RIGS', 'PowerTestRecord') for ec in EventChecklist.objects.all(): # New highscore for the most pythonic BS I've ever written. - PowerTestRecord.objects.create(**{i.name:getattr(ec, i.attname) for i in PowerTestRecord._meta.get_fields() if not (i.auto_created or i.name == "notes")}) + PowerTestRecord.objects.create(event=ec.event, venue=ec.venue, reviewed_by=ec.reviewed_by, **{i.name:getattr(ec, i.attname) for i in PowerTestRecord._meta.get_fields() if not (i.is_relation or i.auto_created or i.name == "notes")}) def revert(apps, schema_editor):