Commit 11e237f1 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Merge branch 'develop' into 'master'

Add rule to take groups in count for courses

See merge request !66
parents e002f970 6a4c80a6
......@@ -70,7 +70,7 @@ class CourseViewSet(viewsets.ModelViewSet):
#)
from django.utils.translation import get_language
current_language = get_language()
query = Q(status='published', lang__contains=[current_language])
query = Q(Q(status='published', lang__contains=[current_language]) & Q(Q(is_public=True, ) | Q(groups__in=self.request.user.groups.all(), status='published')))
if (CourseProfessor.objects.filter(user=self.request.user, role='coordinator').exists()):
query.add(Q(
......
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