From 80e4944314ae8de27adf0d4ffd2e3fe1131f72e8 Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Thu, 7 Feb 2013 16:12:02 -0500 Subject: [PATCH] minor cleanup --- common/djangoapps/student/views.py | 28 ++----------------- common/lib/xmodule/xmodule/modulestore/xml.py | 2 +- lms/djangoapps/courseware/models.py | 4 --- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 235f4b414f..61cb1299b4 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -14,20 +14,19 @@ from django.contrib.auth import logout, authenticate, login from django.contrib.auth.forms import PasswordResetForm from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required +from django.core.cache import cache from django.core.context_processors import csrf from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.core.validators import validate_email, validate_slug, ValidationError from django.db import IntegrityError -from django.http import HttpResponse, HttpResponseForbidden, Http404,\ - HttpResponseRedirect +from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import redirect +from django_future.csrf import ensure_csrf_cookie, csrf_exempt from mitxmako.shortcuts import render_to_response, render_to_string from bs4 import BeautifulSoup -from django.core.cache import cache -from django_future.csrf import ensure_csrf_cookie, csrf_exempt from student.models import (Registration, UserProfile, TestCenterUser, TestCenterUserForm, TestCenterRegistration, TestCenterRegistrationForm, PendingNameChange, PendingEmailChange, @@ -1059,27 +1058,6 @@ def accept_name_change(request): return accept_name_change_by_id(int(request.POST['id'])) -# TODO: This is a giant kludge to give Pearson something to test against ASAP. -# Will need to get replaced by something that actually ties into TestCenterUser -@csrf_exempt -def atest_center_login(request): - if not settings.MITX_FEATURES.get('ENABLE_PEARSON_HACK_TEST'): - raise Http404 - - client_candidate_id = request.POST.get("clientCandidateID") - # registration_id = request.POST.get("registrationID") - exit_url = request.POST.get("exitURL") - error_url = request.POST.get("errorURL") - - if client_candidate_id == "edX003671291147": - user = authenticate(username=settings.PEARSON_TEST_USER, - password=settings.PEARSON_TEST_PASSWORD) - login(request, user) - return redirect('/courses/MITx/6.002x/2012_Fall/courseware/Final_Exam/Final_Exam_Fall_2012/') - else: - return HttpResponseForbidden() - - @csrf_exempt def test_center_login(request): # errors are returned by navigating to the error_url, adding a query parameter named "code" diff --git a/common/lib/xmodule/xmodule/modulestore/xml.py b/common/lib/xmodule/xmodule/modulestore/xml.py index 332b1b1898..d225eef980 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml.py +++ b/common/lib/xmodule/xmodule/modulestore/xml.py @@ -73,7 +73,7 @@ class ImportSystem(XMLParsingSystem, MakoDescriptorSystem): # VS[compat]. Take this out once course conversion is done (perhaps leave the uniqueness check) # tags that really need unique names--they store (or should store) state. - need_uniq_names = ('problem', 'sequential', 'video', 'course', 'chapter', 'videosequence', 'fixedtime') + need_uniq_names = ('problem', 'sequential', 'video', 'course', 'chapter', 'videosequence', 'timelimit') attr = xml_data.attrib tag = xml_data.tag diff --git a/lms/djangoapps/courseware/models.py b/lms/djangoapps/courseware/models.py index 87b9edaac2..78c6e738b0 100644 --- a/lms/djangoapps/courseware/models.py +++ b/lms/djangoapps/courseware/models.py @@ -12,9 +12,6 @@ file and check it in at the same time as your model changes. To do that, ASSUMPTIONS: modules have unique IDs, even across different module_types """ -from datetime import datetime, timedelta -from calendar import timegm - from django.db import models from django.contrib.auth.models import User @@ -211,4 +208,3 @@ class OfflineComputedGradeLog(models.Model): def __unicode__(self): return "[OCGLog] %s: %s" % (self.course_id, self.created) -