From 7627d34339cf5cd439ee5b0e896a933d23e40dd9 Mon Sep 17 00:00:00 2001 From: Kevin Luo Date: Mon, 15 Sep 2014 10:58:09 -0700 Subject: [PATCH] Remove unicode conversion of email since it should always be unicode --- lms/djangoapps/instructor_task/tasks_helper.py | 2 +- lms/djangoapps/instructor_task/tests/test_tasks_helper.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/instructor_task/tasks_helper.py b/lms/djangoapps/instructor_task/tasks_helper.py index ffe5c687c0..c13d22271f 100644 --- a/lms/djangoapps/instructor_task/tasks_helper.py +++ b/lms/djangoapps/instructor_task/tasks_helper.py @@ -547,7 +547,7 @@ def push_grades_to_s3(_xmodule_instance_args, _entry_id, course_id, _task_input, # possible for a student to have a 0.0 show up in their row but # still have 100% for the course. row_percents = [percents.get(label, 0.0) for label in header] - rows.append([student.id, unicode(student.email).encode('utf-8'), student.username, gradeset['percent']] + row_percents) + rows.append([student.id, student.email.encode('utf-8'), student.username, gradeset['percent']] + row_percents) else: # An empty gradeset means we failed to grade a student. num_failed += 1 diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py index af3ae214e1..99bc997a18 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py @@ -48,10 +48,8 @@ class TestInstructorGradeReport(TestCase): """ Test that students with unicode characters in emails is handled. """ - i = 0 - for email in emails: + for i, email in enumerate(emails): self.create_student('student{0}'.format(i), email) - i += 1 self.current_task = Mock() self.current_task.update_state = Mock()