diff --git a/biscuit/apps/alsijil/model_extensions.py b/biscuit/apps/alsijil/model_extensions.py index 728d14640ce0f94b0efd39a47e6f83b96e8223e8..d0470109f683384f2d2c5c98e109b3ceb9a2713a 100644 --- a/biscuit/apps/alsijil/model_extensions.py +++ b/biscuit/apps/alsijil/model_extensions.py @@ -36,17 +36,23 @@ def mark_absent(self, day: date, starting_period: Optional[int] = 0, absent=True # Create and update all personal notes for the discovered lesson periods for lesson_period in lesson_periods: - PersonalNote.objects.update_or_create( + personal_note, created = PersonalNote.objects.update_or_create( person=self, lesson_period=lesson_period, week=wanted_week.week, defaults={ 'absent': absent, - 'excused': excused, - 'remarks': F('remarks') + remarks + 'excused': excused } ) + if remarks: + if personal_note.remarks: + personal_note.remarks += '; %s' % remarks + else: + personal_note.remarks = remarks + personal_note.save() + @LessonPeriod.method def get_personal_notes(self, wanted_week: CalendarWeek):