fix multicourse; fix bug in I4xSystem - self.filestore not set when

filestore not None.  mitxhome.html now properly automatically lists
all courses given in settings.COURSE_SETTINGS.  mitxhome now served
from multicourse.views.  optioninput.html was missing; fixed. cleaned
up access to request.session for coursename in courseware/views.py
This commit is contained in:
ichuang
2012-05-17 22:29:45 -04:00
parent b8b9928a09
commit 5e8fbcdc8d
8 changed files with 77 additions and 31 deletions

View File

@@ -42,6 +42,11 @@ else: # default to 6.002_Spring_2012
#-----------------------------------------------------------------------------
# wrapper functions around course settings
def get_coursename_from_request(request):
if 'coursename' in request.session: coursename = request.session['coursename']
else: coursename = None
return coursename
def get_course_settings(coursename):
if not coursename:
if hasattr(settings,'COURSE_DEFAULT'):

View File

@@ -1 +1,24 @@
# multicourse/views.py
import datetime
import json
import sys
from django.conf import settings
from django.contrib.auth.models import User
from django.core.context_processors import csrf
from django.core.mail import send_mail
from django.http import Http404
from django.http import HttpResponse
from django.shortcuts import redirect
from mitxmako.shortcuts import render_to_response, render_to_string
import courseware.capa.calc
import track.views
from multicourse import multicourse_settings
def mitxhome(request):
''' Home page (link from main header). List of courses. '''
if settings.ENABLE_MULTICOURSE:
context = {'courseinfo' : multicourse_settings.COURSE_SETTINGS}
return render_to_response("mitxhome.html", context)
return info(request)