From 9e157b91f0a0ae432cf072db6bf93cbfd1abacdc Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Tue, 15 Jan 2013 00:59:34 -0500 Subject: [PATCH] change urls from xxx_test_registration to xxx_exam_registration. --- common/djangoapps/student/views.py | 11 ++++++----- lms/templates/dashboard.html | 2 +- lms/templates/test_center_register.html | 2 +- lms/urls.py | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index b41de103ca..12c869cae6 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -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.) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 73c7da23f9..34c8d0ecc3 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -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: diff --git a/lms/templates/test_center_register.html b/lms/templates/test_center_register.html index a0bba90445..679eacf3f4 100644 --- a/lms/templates/test_center_register.html +++ b/lms/templates/test_center_register.html @@ -136,7 +136,7 @@
-
+ % if registration:

diff --git a/lms/urls.py b/lms/urls.py index e81e25e86a..3b476f4821 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -43,8 +43,8 @@ urlpatterns = ('', url(r'^create_account$', 'student.views.create_account'), url(r'^activate/(?P[^/]*)$', 'student.views.activate_account', name="activate"), - url(r'^begin_test_registration/(?P[^/]+/[^/]+/[^/]+)$', '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[^/]+/[^/]+/[^/]+)$', '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