Browse Source

Fix migrace

pull/3/head
Jonas Havelka 2 years ago
parent
commit
05047d547a
  1. 13
      seminar/migrations/0104_hodnoceni_deadline_body.py

13
seminar/migrations/0104_hodnoceni_deadline_body.py

@ -20,8 +20,10 @@ def prirad_deadliny(apps, schema_editor):
if d is None:
d = Deadline.objects.filter(cislo__rocnik=t.rocnik).last()
h.deadline_body = d
h.save()
if d is not None:
h.deadline_body = d
h.save()
continue
except Exception:
pass
@ -49,9 +51,10 @@ def prirad_deadliny(apps, schema_editor):
d = Deadline.objects.filter(cislo=cislo, deadline__gte=h.reseni.cas_doruceni).first()
if d is None:
d = Deadline.objects.filter(cislo=cislo).last()
h.deadline_body = d
h.save()
continue
if d is not None:
h.deadline_body = d
h.save()
continue
log.warning(f"Deadline hodnocení {h.id} se nepodařil určit exaktnějším způsobem. Zkouším další.")

Loading…
Cancel
Save