Commit f943f463 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Filter courses by language

parent 713162b0
......@@ -68,7 +68,9 @@ class CourseViewSet(viewsets.ModelViewSet):
# Q(is_public=True, ) | Q(groups__in=self.request.user.groups.all(), status='published')
# )
#)
query = Q(status='published')
from django.utils.translation import get_language
current_language = get_language()
query = Q(status='published', lang__contains=[current_language])
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