Commit 872f4b6c by Brian Wilson

fix handling of rejected accommodations

parent 4f37ea91
...@@ -7,7 +7,7 @@ from optparse import make_option ...@@ -7,7 +7,7 @@ from optparse import make_option
from django.conf import settings from django.conf import settings
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from student.models import TestCenterRegistration from student.models import TestCenterRegistration, ACCOMMODATION_REJECTED_CODE
class Command(BaseCommand): class Command(BaseCommand):
...@@ -92,6 +92,8 @@ class Command(BaseCommand): ...@@ -92,6 +92,8 @@ class Command(BaseCommand):
record["LastUpdate"] = record["LastUpdate"].strftime("%Y/%m/%d %H:%M:%S") record["LastUpdate"] = record["LastUpdate"].strftime("%Y/%m/%d %H:%M:%S")
record["EligibilityApptDateFirst"] = record["EligibilityApptDateFirst"].strftime("%Y/%m/%d") record["EligibilityApptDateFirst"] = record["EligibilityApptDateFirst"].strftime("%Y/%m/%d")
record["EligibilityApptDateLast"] = record["EligibilityApptDateLast"].strftime("%Y/%m/%d") record["EligibilityApptDateLast"] = record["EligibilityApptDateLast"].strftime("%Y/%m/%d")
if record["Accommodations"] == ACCOMMODATION_REJECTED_CODE:
record["Accommodations"] = ""
if options['force_add']: if options['force_add']:
record['AuthorizationTransactionType'] = 'Add' record['AuthorizationTransactionType'] = 'Add'
......
...@@ -104,8 +104,10 @@ class Command(BaseCommand): ...@@ -104,8 +104,10 @@ class Command(BaseCommand):
except TestCenterUser.DoesNotExist: except TestCenterUser.DoesNotExist:
raise CommandError("User \"{}\" does not have an existing demographics record".format(username)) raise CommandError("User \"{}\" does not have an existing demographics record".format(username))
# check to see if a course_id was specified, and use information from that: # get an "exam" object. Check to see if a course_id was specified, and use information from that:
exam = None
create_dummy_exam = 'create_dummy_exam' in our_options and our_options['create_dummy_exam'] create_dummy_exam = 'create_dummy_exam' in our_options and our_options['create_dummy_exam']
if not create_dummy_exam:
try: try:
course = course_from_id(course_id) course = course_from_id(course_id)
if 'ignore_registration_dates' in our_options: if 'ignore_registration_dates' in our_options:
...@@ -114,9 +116,8 @@ class Command(BaseCommand): ...@@ -114,9 +116,8 @@ class Command(BaseCommand):
else: else:
exam = course.current_test_center_exam exam = course.current_test_center_exam
except ItemNotFoundError: except ItemNotFoundError:
create_dummy_exam = True pass
else:
if exam is None and create_dummy_exam:
# otherwise use explicit values (so we don't have to define a course): # otherwise use explicit values (so we don't have to define a course):
exam_name = "Dummy Placeholder Name" exam_name = "Dummy Placeholder Name"
exam_info = { 'Exam_Series_Code': our_options['exam_series_code'], exam_info = { 'Exam_Series_Code': our_options['exam_series_code'],
......
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