Skip to content

Commit

Permalink
fix: two loops
Browse files Browse the repository at this point in the history
  • Loading branch information
varshamenon4 committed Aug 26, 2024
1 parent 7d7b9ba commit 9600498
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import time

from django.core.management.base import BaseCommand
# from django.db import transaction

from edx_exams.apps.core.models import CourseStaffRole, User

Expand Down Expand Up @@ -44,7 +43,6 @@ def add_arguments(self, parser):
dest='batch_delay',
help='Time delay in seconds for each batch')

# @transaction.atomic
def handle(self, *args, **options):
"""
The main logic and entry point of the management command
Expand Down Expand Up @@ -75,6 +73,8 @@ def add_course_staff_from_csv(self, csv_file, batch_size, batch_delay):
)
time.sleep(batch_delay)

# bulk create course staff
for i in range(0, len(reader), batch_size):
CourseStaffRole.objects.bulk_create(
(CourseStaffRole(
user=User.objects.get(username=row.get('username')),
Expand Down

0 comments on commit 9600498

Please sign in to comment.