From d0e97c708dac07bbeb8782f643f7e5b087b95b80 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 16 Sep 2013 14:51:31 +0200 Subject: [PATCH] only published media in API --- teleforma/views/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 6b20fb15..419e36d9 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -298,7 +298,7 @@ class CourseView(CourseAccessMixin, DetailView): course = Course.objects.get(code=id) media_list = [] for media in course.media.all(): - if media.item.file and media.conference and 'video' in media.mime_type: + if media.is_published and media.item.file and media.conference and 'video' in media.mime_type: urls = [ {'url': settings.MEDIA_URL + unicode(media.item.file), 'mime_type': media.mime_type} ] for transcoded in media.item.transcoded.all(): urls.append({'url':settings.MEDIA_URL + unicode(transcoded.file), 'mime_type': media.mime_type}) -- 2.39.5