Commit 9e157b91 by Brian Wilson

change urls from xxx_test_registration to xxx_exam_registration.

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