diff --git a/courses/templatetags/custom_filters.py b/courses/templatetags/custom_filters.py index d5870be..72d149c 100644 --- a/courses/templatetags/custom_filters.py +++ b/courses/templatetags/custom_filters.py @@ -8,7 +8,7 @@ def show_subject_subscribe(user, subject): if not user is None: if user.is_authenticated: if has_role(user, 'student') and not user.is_staff: - if not user in subject.students.all() and subject.show_subscribe: + if not user in subject.students.all() and user in subject.course.students.all() and subject.show_subscribe: return True return False -- libgit2 0.21.2