change urls from xxx_test_registration to xxx_exam_registration.
This commit is contained in:
@@ -610,7 +610,7 @@ def exam_registration_info(user, course):
|
||||
|
||||
@login_required
|
||||
@ensure_csrf_cookie
|
||||
def begin_test_registration(request, course_id):
|
||||
def begin_exam_registration(request, course_id):
|
||||
""" Handles request to register the user for the current
|
||||
test center exam of the specified course. Called by form
|
||||
in dashboard.html.
|
||||
@@ -649,7 +649,7 @@ def begin_test_registration(request, course_id):
|
||||
return render_to_response('test_center_register.html', context)
|
||||
|
||||
@ensure_csrf_cookie
|
||||
def create_test_registration(request, post_override=None):
|
||||
def create_exam_registration(request, post_override=None):
|
||||
'''
|
||||
JSON call to create a test center exam registration.
|
||||
Called by form in test_center_register.html
|
||||
@@ -662,19 +662,19 @@ def create_test_registration(request, post_override=None):
|
||||
user = User.objects.get(username=username)
|
||||
course_id = post_vars['course_id']
|
||||
course = (course_from_id(course_id)) # assume it will be found....
|
||||
log.info("User {0} enrolled in course {1} clicked on enter/update demographic info for test registration".format(user.username, course_id))
|
||||
|
||||
try:
|
||||
testcenter_user = TestCenterUser.objects.get(user=user)
|
||||
needs_updating = testcenter_user.needs_update(post_vars)
|
||||
needs_updating = testcenter_user.needs_update(post_vars)
|
||||
log.info("User {0} enrolled in course {1} {2}updating demographic info for exam registration".format(user.username, course_id, "" if needs_updating else "not "))
|
||||
except TestCenterUser.DoesNotExist:
|
||||
# do additional initialization here:
|
||||
testcenter_user = TestCenterUser.create(user)
|
||||
needs_updating = True
|
||||
log.info("User {0} enrolled in course {1} creating demographic info for exam registration".format(user.username, course_id))
|
||||
|
||||
# perform validation:
|
||||
if needs_updating:
|
||||
log.info("User {0} enrolled in course {1} updating demographic info for test registration".format(user.username, course_id))
|
||||
# first perform validation on the user information
|
||||
# using a Django Form.
|
||||
form = TestCenterUserForm(instance=testcenter_user, data=post_vars)
|
||||
@@ -706,6 +706,7 @@ def create_test_registration(request, post_override=None):
|
||||
accommodation_request = post_vars.get('accommodation_request','')
|
||||
registration = TestCenterRegistration.create(testcenter_user, exam, accommodation_request)
|
||||
needs_saving = True
|
||||
log.info("User {0} enrolled in course {1} creating new exam registration".format(user.username, course_id))
|
||||
|
||||
if needs_saving:
|
||||
# do validation of registration. (Mainly whether an accommodation request is too long.)
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
<%
|
||||
testcenter_exam_info = course.current_test_center_exam
|
||||
registration = exam_registrations.get(course.id)
|
||||
testcenter_register_target = reverse('begin_test_registration', args=[course.id])
|
||||
testcenter_register_target = reverse('begin_exam_registration', args=[course.id])
|
||||
%>
|
||||
% if testcenter_exam_info is not None:
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<header>
|
||||
<h3 class="is-hidden">Registration Form</h3>
|
||||
</header>
|
||||
<form id="testcenter_register_form" method="post" data-remote="true" action="/create_test_registration">
|
||||
<form id="testcenter_register_form" method="post" data-remote="true" action="/create_exam_registration">
|
||||
|
||||
% if registration:
|
||||
<p class="instructions">
|
||||
|
||||
@@ -43,8 +43,8 @@ urlpatterns = ('',
|
||||
url(r'^create_account$', 'student.views.create_account'),
|
||||
url(r'^activate/(?P<key>[^/]*)$', 'student.views.activate_account', name="activate"),
|
||||
|
||||
url(r'^begin_test_registration/(?P<course_id>[^/]+/[^/]+/[^/]+)$', 'student.views.begin_test_registration', name="begin_test_registration"),
|
||||
url(r'^create_test_registration$', 'student.views.create_test_registration'),
|
||||
url(r'^begin_exam_registration/(?P<course_id>[^/]+/[^/]+/[^/]+)$', 'student.views.begin_exam_registration', name="begin_exam_registration"),
|
||||
url(r'^create_exam_registration$', 'student.views.create_exam_registration'),
|
||||
|
||||
url(r'^password_reset/$', 'student.views.password_reset', name='password_reset'),
|
||||
## Obsolete Django views for password resets
|
||||
|
||||
Reference in New Issue
Block a user