def course_config(request, course_slug):
    from forum.models import Forum
    course = get_object_or_404(CourseOffering, slug=course_slug)
    try:
        forum = Forum.objects.get(offering=course)
    except Forum.DoesNotExist:
        forum = Forum(offering=course)
        forum.enabled = False

    if request.method=="POST":
        form = CourseConfigForm(request.POST)
        if form.is_valid():
            course.set_url(form.cleaned_data['url'])
            course.set_taemail(form.cleaned_data['taemail'])
            #if course.uses_svn():
            #    course.set_indiv_svn(form.cleaned_data['indiv_svn'])
            #    course.set_instr_rw_svn(form.cleaned_data['instr_rw_svn'])
            course.set_group_min(form.cleaned_data['group_min'])
            course.set_group_max(form.cleaned_data['group_max'])
            course.save()
            forum.enabled = form.cleaned_data['forum']
            forum.identity = form.cleaned_data['forum_identity']
            forum.save()
            messages.success(request, 'Course config updated')

            #LOG EVENT#
            l = LogEntry(userid=request.user.username,
                  description=("updated config for %s") % (course),
                  related_object=course)
            l.save()

            return HttpResponseRedirect(reverse('offering:course_info', kwargs={'course_slug': course_slug}))
    else:
        form = CourseConfigForm({'url': course.url(), 'taemail': course.taemail(), 'forum': forum.enabled, 'forum_identity': forum.identity,
                'indiv_svn': course.indiv_svn(), 'instr_rw_svn': course.instr_rw_svn(), 'group_min': course.group_min(),'group_max': course.group_max()})