Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion yaksh/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3185,7 +3185,9 @@ def view_module(request, module_id, course_id, msg=None):
def course_modules(request, course_id, msg=None):
user = request.user
course = Course.objects.get(id=course_id)
if user not in course.students.all():
user_is_not_student = user not in course.students.all()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use course.is_student() mehtod.

user_is_staff = course.is_teacher(user) or course.is_creator(user)
if user_is_not_student and not user_is_staff:
msg = 'You are not enrolled for this course!'
return quizlist_user(request, msg=msg)

Expand Down