Browse Source

Bugfixy v migraci

export_seznamu_prednasek
parent
commit
d54ff1be76
  1. 3
      seminar/migrations/0052_user_to_organizator.py

3
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()

Loading…
Cancel
Save