Commit 92f2fbf0 by David Ormsbee

Ugly, ugly hack needed so that Pearson can test something today, to be replaced…

Ugly, ugly hack needed so that Pearson can test something today, to be replaced by a real implementation later this week or early next.
parent ad93f70e
...@@ -25,7 +25,7 @@ from mitxmako.shortcuts import render_to_response, render_to_string ...@@ -25,7 +25,7 @@ from mitxmako.shortcuts import render_to_response, render_to_string
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from django.core.cache import cache from django.core.cache import cache
from django_future.csrf import ensure_csrf_cookie from django_future.csrf import ensure_csrf_cookie, csrf_exempt
from student.models import (Registration, UserProfile, from student.models import (Registration, UserProfile,
PendingNameChange, PendingEmailChange, PendingNameChange, PendingEmailChange,
CourseEnrollment) CourseEnrollment)
...@@ -774,3 +774,22 @@ def accept_name_change(request): ...@@ -774,3 +774,22 @@ def accept_name_change(request):
raise Http404 raise Http404
return accept_name_change_by_id(int(request.POST['id'])) return accept_name_change_by_id(int(request.POST['id']))
@csrf_exempt
def test_center_login(request):
if not 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":
authenticate(username="pearson", password="12345")
return redirect('/courses/MITx/6.002x/2012_Fall/courseware/Final_Exam/Final_Exam_Fall_2012/')
else:
raise Http404
...@@ -26,6 +26,11 @@ urlpatterns = ('', ...@@ -26,6 +26,11 @@ urlpatterns = ('',
url(r'^reject_name_change$', 'student.views.reject_name_change'), url(r'^reject_name_change$', 'student.views.reject_name_change'),
url(r'^pending_name_changes$', 'student.views.pending_name_changes'), url(r'^pending_name_changes$', 'student.views.pending_name_changes'),
url(r'^testcenter/login$', 'student.views.test_center_login'),
# url(r'^testcenter/login$', 'student.test_center_views.login'),
# url(r'^testcenter/logout$', 'student.test_center_views.logout'),
url(r'^event$', 'track.views.user_track'), url(r'^event$', 'track.views.user_track'),
url(r'^t/(?P<template>[^/]*)$', 'static_template_view.views.index'), # TODO: Is this used anymore? What is STATIC_GRAB? url(r'^t/(?P<template>[^/]*)$', 'static_template_view.views.index'), # TODO: Is this used anymore? What is STATIC_GRAB?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment