diff --git a/biscuit/apps/chronos/migrations/0001_initial.py b/biscuit/apps/chronos/migrations/0001_initial.py index ee4f83f64154c1a7883785b1a01e9bf1c7287151..6fdf91d7c6bf58646b064dc99b6fb640de6191c7 100644 --- a/biscuit/apps/chronos/migrations/0001_initial.py +++ b/biscuit/apps/chronos/migrations/0001_initial.py @@ -87,10 +87,10 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('week', models.IntegerField(default=biscuit.apps.chronos.util.current_week, verbose_name='Week')), ('lesson_period', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='substitutions', to='chronos.LessonPeriod')), - ('room', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='chronos.Room')), + ('room', models.ForeignKey(null=True, blank=True, on_delete=django.db.models.deletion.CASCADE, to='chronos.Room')), ('school', models.ForeignKey(default=biscuit.core.util.core_helpers.get_current_school, on_delete=django.db.models.deletion.CASCADE, to='core.School')), - ('subject', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='lesson_substitutions', to='chronos.Subject')), - ('teachers', models.ManyToManyField(related_name='lesson_substitutions', to='core.Person')), + ('subject', models.ForeignKey(null=True, blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='lesson_substitutions', to='chronos.Subject')), + ('teachers', models.ManyToManyField(null=True, blank=True, related_name='lesson_substitutions', to='core.Person')), ], options={ 'ordering': ['lesson_period__lesson__date_start', 'week', 'lesson_period__period__weekday', 'lesson_period__period__period'], diff --git a/biscuit/apps/chronos/models.py b/biscuit/apps/chronos/models.py index 9a5d529038dac514076f0334f07e7dce626e1e1a..744ba2157d3184fe8dc855a3b2afbac338a0a525 100644 --- a/biscuit/apps/chronos/models.py +++ b/biscuit/apps/chronos/models.py @@ -116,10 +116,10 @@ class LessonSubstitution(SchoolRelated): subject = models.ForeignKey( 'Subject', on_delete=models.CASCADE, - related_name='lesson_substitutions', null=True) + related_name='lesson_substitutions', null=True, blank=True) teachers = models.ManyToManyField('core.Person', - related_name='lesson_substitutions') - room = models.ForeignKey('Room', models.CASCADE, null=True) + related_name='lesson_substitutions', blank=True, null=True) + room = models.ForeignKey('Room', models.CASCADE, null=True, blank=True) cancelled = models.BooleanField(default=False)