If setting COURSES_ARE_BROWSABLE is off return 404 on /courses

This commit is contained in:
Usman Khalid
2013-09-23 15:19:32 +00:00
parent 3ff203d11f
commit b2af990d3c

View File

@@ -1,5 +1,6 @@
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import redirect
from django_future.csrf import ensure_csrf_cookie
from mitxmako.shortcuts import render_to_response
@@ -48,6 +49,9 @@ def courses(request):
if settings.MITX_FEATURES.get('ENABLE_MKTG_SITE', False):
return redirect(marketing_link('COURSES'), permanent=True)
if not settings.MITX_FEATURES.get('COURSES_ARE_BROWSABLE'):
raise Http404
university = branding.get_university(request.META.get('HTTP_HOST'))
if university == 'edge':
return render_to_response('university_profile/edge.html', {})