From a383e034b340e671fefb42601b63d54f7ab39209 Mon Sep 17 00:00:00 2001 From: Varsha Menon Date: Fri, 29 Mar 2024 10:59:13 -0400 Subject: [PATCH] fix: change open for dictreader --- .../core/management/commands/bulk_add_course_staff.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/edx_exams/apps/core/management/commands/bulk_add_course_staff.py b/edx_exams/apps/core/management/commands/bulk_add_course_staff.py index a6f32786..8307c74c 100644 --- a/edx_exams/apps/core/management/commands/bulk_add_course_staff.py +++ b/edx_exams/apps/core/management/commands/bulk_add_course_staff.py @@ -53,9 +53,13 @@ def handle(self, *args, **options): batch_size = options['batch_size'] batch_delay = options['batch_delay'] - if csv_path: - with open(csv_path, 'rb') as csv_file: - self.add_course_staff_from_csv(csv_file, batch_size, batch_delay) + # if csv_path: + # with open(csv_path, 'rb') as csv_file: + # self.add_course_staff_from_csv(csv_file, batch_size, batch_delay) + + # if csv_path: + with open(csv_path) as csv_file: + self.add_course_staff_from_csv(csv_file, batch_size, batch_delay) logger.info('Bulk add course staff complete!')