diff --git a/askbot b/askbot index 1c3381046c..e56ae38084 160000 --- a/askbot +++ b/askbot @@ -1 +1 @@ -Subproject commit 1c3381046c78e055439ba1c78e0df48410fcc13e +Subproject commit e56ae380846f7c6cdaeacfc58880fab103540491 diff --git a/cms/envs/common.py b/cms/envs/common.py index 3f8f4440c5..6faecafec1 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -83,7 +83,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'django.core.context_processors.static', 'django.contrib.messages.context_processors.messages', - 'django.core.context_processors.auth', # this is required for admin + 'django.contrib.auth.context_processors.auth', # this is required for admin 'django.core.context_processors.csrf', # necessary for csrf protection ) @@ -121,6 +121,7 @@ MIDDLEWARE_CLASSES = ( ) ############################ SIGNAL HANDLERS ################################ +# This is imported to register the exception signal handling that logs exceptions import monitoring.exceptions # noqa ############################ DJANGO_BUILTINS ################################ diff --git a/cms/urls.py b/cms/urls.py index 15aa11ba8f..b5badb89b8 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -1,5 +1,5 @@ from django.conf import settings -from django.conf.urls.defaults import patterns, include, url +from django.conf.urls import patterns, include, url import django.contrib.auth.views diff --git a/common/djangoapps/util/json_request.py b/common/djangoapps/util/json_request.py index c2fad16d70..391905e574 100644 --- a/common/djangoapps/util/json_request.py +++ b/common/djangoapps/util/json_request.py @@ -9,7 +9,7 @@ def expect_json(view_function): if request.META['CONTENT_TYPE'] == "application/json": cloned_request = copy.copy(request) cloned_request.POST = cloned_request.POST.copy() - cloned_request.POST.update(json.loads(request.raw_post_data)) + cloned_request.POST.update(json.loads(request.body)) return view_function(cloned_request, *args, **kwargs) else: return view_function(request, *args, **kwargs) diff --git a/common/djangoapps/util/middleware.py b/common/djangoapps/util/middleware.py deleted file mode 100644 index ce7b961766..0000000000 --- a/common/djangoapps/util/middleware.py +++ /dev/null @@ -1,16 +0,0 @@ -import logging - -from django.conf import settings -from django.http import HttpResponseServerError - -log = logging.getLogger("mitx") - - -class ExceptionLoggingMiddleware(object): - """Just here to log unchecked exceptions that go all the way up the Django - stack""" - - if not settings.TEMPLATE_DEBUG: - def process_exception(self, request, exception): - log.exception(exception) - return HttpResponseServerError("Server Error - Please try again later.") diff --git a/lms/djangoapps/courseware/courses.py b/lms/djangoapps/courseware/courses.py index 47d5777f8d..5312a38584 100644 --- a/lms/djangoapps/courseware/courses.py +++ b/lms/djangoapps/courseware/courses.py @@ -182,7 +182,7 @@ def get_courses_by_university(user): courses = sorted(courses, key=lambda course: course.number) universities = defaultdict(list) for course in courses: - if settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION'): + if settings.MITX_FEATURES.get('ACCESS_REQUIRE_STAFF_FOR_COURSE'): if not has_access_to_course(user,course): continue universities[course.org].append(course) diff --git a/lms/djangoapps/heartbeat/urls.py b/lms/djangoapps/heartbeat/urls.py index f8047eb00a..6049374dac 100644 --- a/lms/djangoapps/heartbeat/urls.py +++ b/lms/djangoapps/heartbeat/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import * urlpatterns = patterns('', url(r'^$', 'heartbeat.views.heartbeat', name='heartbeat'), diff --git a/lms/djangoapps/simplewiki/urls.py b/lms/djangoapps/simplewiki/urls.py index 6179345f9a..cf243e0bd3 100644 --- a/lms/djangoapps/simplewiki/urls.py +++ b/lms/djangoapps/simplewiki/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url namespace_regex = r"[a-zA-Z\d._-]+" article_slug = r'/(?P' + namespace_regex + r'/[a-zA-Z\d_-]*)' diff --git a/lms/djangoapps/staticbook/views.py b/lms/djangoapps/staticbook/views.py index 948e66b50c..cb15f5855e 100644 --- a/lms/djangoapps/staticbook/views.py +++ b/lms/djangoapps/staticbook/views.py @@ -2,12 +2,14 @@ from django.contrib.auth.decorators import login_required from mitxmako.shortcuts import render_to_response from courseware.courses import check_course - +from lxml import etree @login_required def index(request, course_id, page=0): course = check_course(course_id) - return render_to_response('staticbook.html', {'page': int(page), 'course': course}) + raw_table_of_contents = open('lms/templates/book_toc.xml', 'r') # TODO: This will need to come from S3 + table_of_contents = etree.parse(raw_table_of_contents).getroot() + return render_to_response('staticbook.html', {'page': int(page), 'course': course, 'table_of_contents': table_of_contents}) def index_shifted(request, course_id, page): diff --git a/lms/envs/common.py b/lms/envs/common.py index bd77e711b3..487e2efe48 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -109,7 +109,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.messages.context_processors.messages', #'django.core.context_processors.i18n', 'askbot.user_messages.context_processors.user_messages',#must be before auth - 'django.core.context_processors.auth', #this is required for admin + 'django.contrib.auth.context_processors.auth', #this is required for admin 'django.core.context_processors.csrf', #necessary for csrf protection ) @@ -173,6 +173,9 @@ MODULESTORE = { } } +############################ SIGNAL HANDLERS ################################ +# This is imported to register the exception signal handling that logs exceptions +import monitoring.exceptions # noqa ############################### DJANGO BUILT-INS ############################### # Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here @@ -285,7 +288,6 @@ TEMPLATE_LOADERS = ( ) MIDDLEWARE_CLASSES = ( - 'util.middleware.ExceptionLoggingMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py index 2256decb46..288a99bf3b 100644 --- a/lms/envs/dev_ike.py +++ b/lms/envs/dev_ike.py @@ -16,3 +16,8 @@ MITX_FEATURES['ENABLE_TEXTBOOK'] = False MITX_FEATURES['ENABLE_DISCUSSION'] = False MITX_FEATURES['ACCESS_REQUIRE_STAFF_FOR_COURSE'] = True # require that user be in the staff_* group to be able to enroll +#----------------------------------------------------------------------------- +# disable django debug toolbars + +INSTALLED_APPS = tuple([ app for app in INSTALLED_APPS if not app.startswith('debug_toolbar') ]) +MIDDLEWARE_CLASSES = tuple([ mcl for mcl in MIDDLEWARE_CLASSES if not mcl.startswith('debug_toolbar') ]) diff --git a/lms/templates/book_toc.html b/lms/templates/book_toc.html deleted file mode 100644 index ed4794da65..0000000000 --- a/lms/templates/book_toc.html +++ /dev/null @@ -1,356 +0,0 @@ -
  • Contents ix -
  • Preamble i - - -
  • 1 The Circuit Abstraction 3 -
  • 2 Resistive Networks 53 -
  • 3 Network Theorems 119 -
  • 4 Analysis of Nonlinear Circuits 193 -
  • 5 The Digital Abstraction 243 -
  • 6 The MOSFET Switch 285 -
  • 7 The MOSFET Amplifier 331 -
  • 8 The Small Signal Model 405 -
  • 9 Energy Storage Elements 457 -
  • 10 First-order Transients 503 -
  • 11 Energy and Power in Digital Circuits 595 -
  • 12 Transients in Second Order Circuits 625 -
  • 13 Sinusoidal Steady State 703 -
  • 14 Sinusoidal Steady State: Resonance 777 -
  • 15 The Operational Amplifier Abstraction 837 -
  • 16 Diodes 905 -
  • A1 Maxwell's Equations and the LMD 927 -
  • B Trigonometric Functions & Identities 941 -
  • C Complex Numbers 947 -
  • D Solving Simultaneous Linear Equations 957 - - -
  • Answers to Selected Problems 959 -
  • Figure Acknowledgments 971 -
  • Index 973 diff --git a/lms/templates/book_toc.xml b/lms/templates/book_toc.xml new file mode 100644 index 0000000000..88dc016905 --- /dev/null +++ b/lms/templates/book_toc.xml @@ -0,0 +1,413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lms/templates/staff_problem_info.html b/lms/templates/staff_problem_info.html index 483acbd9cf..a8aaae0cb9 100644 --- a/lms/templates/staff_problem_info.html +++ b/lms/templates/staff_problem_info.html @@ -2,18 +2,14 @@ ${module_content} %if edit_link:
    Edit
    % endif +
    Staff Debug Info
    - - -
    - diff --git a/lms/templates/staticbook.html b/lms/templates/staticbook.html index dbc5bb1cec..804676de97 100644 --- a/lms/templates/staticbook.html +++ b/lms/templates/staticbook.html @@ -4,6 +4,7 @@ <%block name="headextra"> <%static:css group='course'/> +<%static:js group='courseware'/> <%block name="js_extra"> @@ -71,7 +72,24 @@ $("#open_close_accordion a").click(function(){ diff --git a/lms/urls.py b/lms/urls.py index 0d6b3b64b9..bb3952b73c 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -1,5 +1,5 @@ from django.conf import settings -from django.conf.urls.defaults import patterns, include, url +from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf.urls.static import static diff --git a/requirements.txt b/requirements.txt index 33b2bfeb05..ef16d2c577 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -django<1.4 +django>=1.4,<1.5 pip numpy scipy