From 2a367eb591e68042605eb6dcbc15c41a139ee8a2 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Sun, 1 Sep 2019 20:25:10 +0200 Subject: [PATCH] Disabled pre-filled form fields. --- biscuit/apps/chronos/forms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/biscuit/apps/chronos/forms.py b/biscuit/apps/chronos/forms.py index e0076d08..85d7b66f 100644 --- a/biscuit/apps/chronos/forms.py +++ b/biscuit/apps/chronos/forms.py @@ -25,7 +25,11 @@ class LessonSubstitutionForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self.fields['lesson_period'].queryset = LessonPeriod.objects.all() self.fields['subject'].queryset = Subject.objects.all() self.fields['teachers'].queryset = Person.objects.all() self.fields['room'].queryset = Room.objects.all() + + self.fields['week'].disabled = True + self.fields['lesson_period'].disabled = True -- GitLab