From d54ff1be76cdb1a6a5f229d8434c94d84234e440 Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Fri, 17 May 2019 00:44:24 +0200 Subject: [PATCH] Bugfixy v migraci --- seminar/migrations/0052_user_to_organizator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seminar/migrations/0052_user_to_organizator.py b/seminar/migrations/0052_user_to_organizator.py index 15d9102e..8bdf9ef0 100644 --- a/seminar/migrations/0052_user_to_organizator.py +++ b/seminar/migrations/0052_user_to_organizator.py @@ -7,6 +7,7 @@ from django.db import migrations def spoj_k_organizatorum_osoby(apps, scema_editor): Organizator = apps.get_model('seminar', 'Organizator') Resitel = apps.get_model('seminar', 'Resitel') + Osoba = apps.get_model('seminar', 'Osoba') for org in Organizator.objects.all(): # Spárování organizátora s osobou @@ -21,7 +22,6 @@ def spoj_k_organizatorum_osoby(apps, scema_editor): # Přesun informací z organizátora do jeho osoby osoba.prezdivka = org.prezdivka osoba.foto = org.foto - osoba.foto_male = org.foto_male # Všechno uložit osoba.save() @@ -54,6 +54,7 @@ def fix_novinka(apps, schema_editor): Organizator = apps.get_model('seminar', 'Organizator') for nov in Novinky.objects.all(): nov.autor = Organizator.objects.filter(osoba__user=nov.autor_old).first() + nov.save()