diff --git a/aleksis/apps/alsijil/util/predicates.py b/aleksis/apps/alsijil/util/predicates.py index c2ce7d98a7e8d0cd4b2f02700f2e055fb294e019..de57ee133d4e4ba5bd8b4c3c39bf5fcabdaa3f60 100644 --- a/aleksis/apps/alsijil/util/predicates.py +++ b/aleksis/apps/alsijil/util/predicates.py @@ -310,11 +310,10 @@ def is_course_teacher(user: User, obj: Course): def is_lesson_event_teacher(user: User, obj: LessonEvent): """Predicate for teachers of a lesson event. - Checks whether the person linked to the user is a teacher in the lesson event, - or a teacher of the course, if the lesson event has one. + Checks whether the person linked to the user is a teacher in the lesson event. """ if obj: - return obj.course and is_course_teacher(user, obj.course) or user.person in obj.all_teachers + return user.person in obj.all_teachers return False @@ -419,8 +418,6 @@ def can_edit_documentation(user: User, obj: Documentation): return is_lesson_event_teacher(user, obj.lesson_event) | is_lesson_event_group_owner( user, obj.lesson_event ) - if obj.course: - return is_course_teacher(user, obj.course) return False