Skip to content
Snippets Groups Projects
Commit 9c92bdfc authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch '118-check-if-getters-for-lesson-periods-work-correctly' into 'master'

Resolve "Check if getters for lesson periods work correctly"

Closes #118

See merge request !141
parents e13bc720 0ac850c2
Branches 130-show-print-timetable-button-on-mobile-devices
No related tags found
1 merge request!141Resolve "Check if getters for lesson periods work correctly"
Pipeline #6688 canceled
......@@ -453,14 +453,16 @@ class LessonPeriod(WeekAnnotationMixin, TeacherPropertiesMixin, ExtensibleModel)
return None
def get_subject(self) -> Optional[Subject]:
if self.get_substitution() and self.get_substitution().subject:
return self.get_substitution().subject
sub = self.get_substitution()
if sub and sub.subject:
return sub.subject
else:
return self.lesson.subject
def get_teachers(self) -> models.query.QuerySet:
if self.get_substitution():
return self.get_substitution().teachers
sub = self.get_substitution()
if sub and sub.teachers.all():
return sub.teachers
else:
return self.lesson.teachers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment