Commit b71d5741 authored by Eduardo Nunes's avatar Eduardo Nunes
Browse files

Fixing professor assistant filter in BasicClass

parent 7016eba2
......@@ -23,8 +23,8 @@ class BasicClassViewSet(viewsets.ReadOnlyModelViewSet):
if not (self.request.user.is_staff or self.request.user.is_superuser):
queryset = queryset.filter(
Q(course__professors=self.request.user, course__course_professors__role__in=['coordinator', 'assistant']) |
Q(assistants=self.request.user)
Q(course__professors=self.request.user, course__course_professors__role__in=['coordinator']) |
(Q(course__professors=self.request.user, course__course_professors__role__in=['assistant']) & Q(assistants=self.request.user))
).distinct()
queryset = queryset.prefetch_related('assistants')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment