Commit 553528cd by Brian Wilson Committed by Ashley Penney

change get_testcenter_registration to get_tc_registration, so it's not treated as a test.

parent d30974b5
...@@ -4,7 +4,7 @@ from time import strftime ...@@ -4,7 +4,7 @@ from time import strftime
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from student.models import TestCenterUser, TestCenterRegistration, TestCenterRegistrationForm, get_testcenter_registration from student.models import TestCenterUser, TestCenterRegistration, TestCenterRegistrationForm, get_tc_registration
from student.views import course_from_id from student.views import course_from_id
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
...@@ -134,7 +134,7 @@ class Command(BaseCommand): ...@@ -134,7 +134,7 @@ class Command(BaseCommand):
# create and save the registration: # create and save the registration:
needs_updating = False needs_updating = False
registrations = get_testcenter_registration(student, course_id, exam_code) registrations = get_tc_registration(student, course_id, exam_code)
if len(registrations) > 0: if len(registrations) > 0:
registration = registrations[0] registration = registrations[0]
for fieldname in UPDATE_FIELDS: for fieldname in UPDATE_FIELDS:
...@@ -181,7 +181,7 @@ class Command(BaseCommand): ...@@ -181,7 +181,7 @@ class Command(BaseCommand):
change_internal = False change_internal = False
if 'exam_series_code' in our_options: if 'exam_series_code' in our_options:
exam_code = our_options['exam_series_code'] exam_code = our_options['exam_series_code']
registration = get_testcenter_registration(student, course_id, exam_code)[0] registration = get_tc_registration(student, course_id, exam_code)[0]
for internal_field in [ 'upload_error_message', 'upload_status', 'authorization_id']: for internal_field in [ 'upload_error_message', 'upload_status', 'authorization_id']:
if internal_field in our_options: if internal_field in our_options:
registration.__setattr__(internal_field, our_options[internal_field]) registration.__setattr__(internal_field, our_options[internal_field])
......
...@@ -9,7 +9,7 @@ from django.test import TestCase ...@@ -9,7 +9,7 @@ from django.test import TestCase
from student.models import User, TestCenterRegistration, TestCenterUser from student.models import User, TestCenterRegistration, TestCenterUser
# This is stupid! Because I import a function with the word "test" in the name, # This is stupid! Because I import a function with the word "test" in the name,
# the unittest framework tries to run *it* as a test?! Crazy! # the unittest framework tries to run *it* as a test?! Crazy!
from student.models import get_testcenter_registration as get_tc_registration from student.models import get_tc_registration
from django.core import management from django.core import management
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -547,7 +547,7 @@ class TestCenterRegistrationForm(ModelForm): ...@@ -547,7 +547,7 @@ class TestCenterRegistrationForm(ModelForm):
def get_testcenter_registration(user, course_id, exam_series_code): def get_tc_registration(user, course_id, exam_series_code):
try: try:
tcu = TestCenterUser.objects.get(user=user) tcu = TestCenterUser.objects.get(user=user)
except TestCenterUser.DoesNotExist: except TestCenterUser.DoesNotExist:
......
...@@ -31,7 +31,7 @@ from student.models import (Registration, UserProfile, TestCenterUser, TestCente ...@@ -31,7 +31,7 @@ from student.models import (Registration, UserProfile, TestCenterUser, TestCente
TestCenterRegistration, TestCenterRegistrationForm, TestCenterRegistration, TestCenterRegistrationForm,
PendingNameChange, PendingEmailChange, PendingNameChange, PendingEmailChange,
CourseEnrollment, unique_id_for_user, CourseEnrollment, unique_id_for_user,
get_testcenter_registration) get_tc_registration)
from certificates.models import CertificateStatuses, certificate_status_for_student from certificates.models import CertificateStatuses, certificate_status_for_student
...@@ -612,7 +612,7 @@ def exam_registration_info(user, course): ...@@ -612,7 +612,7 @@ def exam_registration_info(user, course):
return None return None
exam_code = exam_info.exam_series_code exam_code = exam_info.exam_series_code
registrations = get_testcenter_registration(user, course.id, exam_code) registrations = get_tc_registration(user, course.id, exam_code)
if registrations: if registrations:
registration = registrations[0] registration = registrations[0]
else: else:
...@@ -712,7 +712,7 @@ def create_exam_registration(request, post_override=None): ...@@ -712,7 +712,7 @@ def create_exam_registration(request, post_override=None):
needs_saving = False needs_saving = False
exam = course.current_test_center_exam exam = course.current_test_center_exam
exam_code = exam.exam_series_code exam_code = exam.exam_series_code
registrations = get_testcenter_registration(user, course_id, exam_code) registrations = get_tc_registration(user, course_id, exam_code)
if registrations: if registrations:
registration = registrations[0] registration = registrations[0]
# NOTE: we do not bother to check here to see if the registration has changed, # NOTE: we do not bother to check here to see if the registration has changed,
......
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