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 63228c08..f6960832 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 @@ -4,7 +4,7 @@ import time from django.core.management.base import BaseCommand -from django.db import transaction, IntegrityError +from django.db import IntegrityError, transaction from edx_exams.apps.core.models import CourseStaffRole, User @@ -78,7 +78,7 @@ def add_course_staff_from_csv(self, csv_file, batch_size, batch_delay): f'user with username.' ) continue - users_dict = dict([(u.username, u) for (u, c) in users_list]) + users_dict = {(u.username, u) for (u, c) in users_list} users.update(users_dict) time.sleep(batch_delay)