Skip to content

Commit d9e5b08

Browse files
committed
Use model method based on review feedback
1 parent 8740ad6 commit d9e5b08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yaksh/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3185,7 +3185,7 @@ def view_module(request, module_id, course_id, msg=None):
31853185
def course_modules(request, course_id, msg=None):
31863186
user = request.user
31873187
course = Course.objects.get(id=course_id)
3188-
user_is_not_student = user not in course.students.all()
3188+
user_is_not_student = course.is_student(user)
31893189
user_is_staff = course.is_teacher(user) or course.is_creator(user)
31903190
if user_is_not_student and not user_is_staff:
31913191
msg = 'You are not enrolled for this course!'

0 commit comments

Comments
 (0)